clang-16: Fix simple unused-but-set variables Clang-16 is flagging variables as unused-but-set-variables resulting in build errors when --enable-warning is used. db_verify.c:996:9: error: variable 'builtinUsers' set but not used [-Werror,-Wunused-but-set-variable] int builtinUsers = 0; ^ Remove the variables that are set but never actually used. This commit fixes the simpler cases where variables are only set but not used elsewhere. Change-Id: I45674871cfc70a7e57c7c3e2d74ec81a4433a7c4 Reviewed-on: https://gerrit.openafs.org/15178 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
bucoord: Fix doDispatch() array-parameter gcc warning The doDispatch() prototype does not match the function definition. The targv parameter is declared as an unbounded array in the prototype, but is defined as a bounded array. As of GCC 12, a warning is issued for the mismatch. main.c:346:18: error: argument 2 of type ‘char *[100]’ with mismatched bound [-Werror=array-parameter=] bucoord_internal.h:123:40: note: previously declared as ‘char *[]’ Within doDispatch(), the targv argument is just passed to cmd_Dispatch() (this is the only use of targv). Since cmd_Displatch() expects an unbounded array, update the doDispatch() definition to match the prototype. Change-Id: I50a170b3490d0d4e5d971b9ccb483cccb6833686 Reviewed-on: https://gerrit.openafs.org/14771 Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Avoid duplicate definitions of globals GCC 10 changed a default flag from -fcommon to -fno-common. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85678 for some background. The change in gcc 10 results in build link-time errors. For example: ../../src/xstat/.libs/liboafs_xstat_cm.a(xstat_cm.o):(.bss+0x2050): multiple definition of `numCollections'; Ensure that only one definition for global data objects exist and change references to use "extern" as needed. To ensure that future changes do not introduce duplicated global definitions, add the -fno-common flag to XCFLAGS when using the configure --enable-checking setting. Change-Id: I6780dd995fe6fb6c2102765ff3484c18e1e1cd58 Reviewed-on: https://gerrit.openafs.org/14106 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
OPENAFS-SA-2018-001 backup: use authenticated connection to butc Use the standard routine to pick a client security object, instead of always assuming rxnull. Respect -localauth as well as being able to use the current user's tokens, but also provide a -nobutcauth argument to fall back to the historical rxnull behavior (but only for the connections to butc; vldb and budb connections are not affected). Change-Id: Ibf8ebe5521bee8d0f7162527e26bc5541d07910d
cmd: add flags argument to create syntax function Add the flags argument to cmd_CreateSyntax() and update all callers. The flags argument will be used to set command options, such as CMD_HIDDEN. Change-Id: Ia51be9635f262516cb084d236a9e0756f608bf16 Reviewed-on: http://gerrit.openafs.org/11430 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
backup deletedump: Change -port to -portoffset Use -portoffset instead of -port, for consistency with all of the other backup suite commands. Leave -port in as an alias, for backwards compatibility. Currently -port will mean -portoffset anyway, since it's an unambiguous abbreviation, but put in the alias explicitly, just in case some other option comes along starting with -port. Change-Id: I2f8aaa34fdf9e7c80a8fec1dc1caf63d9b7192b1 Reviewed-on: http://gerrit.openafs.org/10440 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
backup: Display general help on -help Currently, 'backup' tries to guess if we are running 'backup interactive' before libcmd actually parses our arguments. This is tricky, since we run 'backup interactive' if no explicit subcommand is actually given. One consequence of this is that currently, running 'backup -help' just displays the help for the 'backup interactive' command, not the help output for 'backup' itself. The current heuristics for guessing at whether we are running 'backup interactive' or not are a bit fishy, but at least for now, just make sure -help works. This should still ensure any other behavior is unchanged, but just 'backup -help' now works like other command suites. Change-Id: I31ecbcad7efffd301d23f109c66eee0417882a90 Reviewed-on: http://gerrit.openafs.org/10439 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
bucoord: Remove dead assignments in cmd init Don't assign command syntax objects to 'ts' if we're not going to add any parameters to them Change-Id: I69f6e090fc115ab213c1f20dc46da81f2878e0a3 Reviewed-on: http://gerrit.openafs.org/9260 Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
vol: fix everything to use volumeid type use one type for volumeid, not 3. kill VolId, and stop using afs_uint32 (and a few times, afs_int32) Change-Id: Ibcbd09b5a24d8720b02a02f926e6f59dc0f529aa Reviewed-on: http://gerrit.openafs.org/8845 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Change -n to -dryrun for backup subcommands Change -n to -dryrun for "don't do it, show it though" operation to be in line with agreement on -dryrun in place of -noexecute or -n. Updated man page POD sources to reflect the changes and updated README to remove these specific todo line items. Change-Id: I5c1361dcc866ea3d1efbb0c0ddcd4a7fe513c816 Reviewed-on: http://gerrit.openafs.org/4827 Reviewed-by: Jeffrey Altman <jaltman@openafs.org> Tested-by: Jeffrey Altman <jaltman@openafs.org>
Hide -noexecute in favor of -dryrun Makes all previous -noexecute arguments hidden (still callable) and replaces them with -dryrun whose help text has been made common where appropriate instead of the 3 previous ways the argument was explained. Change-Id: I0ef3daa88dc771d972131358dc6e8a23ecd5a33b Reviewed-on: http://gerrit.openafs.org/4678 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
bu*: Tidy header includes Since we adopted libroken, we get a lot of header includes automatically from roken.h. Use these, instead of including lots of things multiple times. Change-Id: If20a2ef67d4cbc70156c1707264a5b7360cfa11a Reviewed-on: http://gerrit.openafs.org/4323 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
libroken: Build on windows A minimal change set to get libroken to build on Windows. Sadly, libroken contains definitions for a number of platform compatibility macros which were previously scattered throughout the windows code. These scattered macros have to be removed in order to build libroken. The impact of this removal is that a very large number of files throughout the tree require the addition of "roken.h" to pick up the new compatibility code. The bulk of this change is adding these includes. In addition, some of the added includes add roken dependencies to the Unix build. So, also add libroken to the build rules in affected Unix Makefiles. Change-Id: Ifba431bd37e67b1e273fbc6f69b805a232193456 Reviewed-on: http://gerrit.openafs.org/3205 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
death to trailing whitespace if we're gonna clean up... Change-Id: I5ab03f29468577b62dacab41a67eadfd8c43f812 Reviewed-on: http://gerrit.openafs.org/2463 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
death to register in soviet compilers, compiler optimizes you. stop providing dated (and annoying for debugging) register keywords. Change-Id: Ibcac0aa3f353fe531b9be0beedca919fb947bfab Reviewed-on: http://gerrit.openafs.org/2436 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Don't pass tokens around the backup system The backup system has a global ktc_token, which is used to work out when its credentials are about to expire. This leads to an unfortunate dependency throughout the code on the format of this token. Replace this with a global time_t which stores the expiry time, and copy the required field from the token into this when we get the token. This limits the exposure of the token, and simplifies the code. Change-Id: Ia2929c2c0a4c1ba9ca5db881865f33af5a732d2f Reviewed-on: http://gerrit.openafs.org/1218 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Remove internal vldbClientInit prototype vldbClientInit is used by other modules in the backup suite, and is already prototyped in bucoord_prototypes.h. So, remove it from the internal header. Change-Id: I2688426189c3aeaacc8db4f815ede466caa5dde0 Reviewed-on: http://gerrit.openafs.org/1205 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Further code cleanup for the backup suite Protect butm.h against multiple inclusion Prototype more functions for internal use in bucoord Remove some unused variables Include additional headers as required Prototype exported functions in budb Make SendReturnList helper function generic, by using a void * rock Reviewed-on: http://gerrit.openafs.org/http://gerrit.openafs.org/168 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Rework bucoord prototypes for external dlq use Rework prototyping in the bucoord directory so that bucoord_prototypes.h can be used by others who need definitions of the dlq_* types. Add additional prototyping and header includes so these types work correctly No Windows specific changes are required, as the NTMakefile doesn't have header dependencies Reviewed-on: http://gerrit.openafs.org/35 Verified-by: Russ Allbery <rra@stanford.edu> Reviewed-by: Russ Allbery <rra@stanford.edu>
Remove the RCSID macro The move to git means that we can no longer populate the RCSID macro in the way that it was used with CVS. This patch simply removes the macro from every file, except where it contains information from upstream (and it's in a comment). Reviewed-on: http://gerrit.openafs.org/14 Verified-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Derrick Brashear <shadow@dementia.org>