matchLength is set regardless of what the separator is, so we don't need
to provide a default value.
Caught by clang-analyzer
Change-Id: Iac8fe8db8832cf2b3347ec1bdacc7245bddf542b
Reviewed-on: http://gerrit.openafs.org/9257
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
code is set to a real value on every code path, so don't bother
initialising it to 0 midway through the function.
Change-Id: I334286f2ae854c57df781af8df78e5a1bf8e9b2b
Reviewed-on: http://gerrit.openafs.org/9256
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
In UV_RestoreVolume2, there is a success flag whose only use is ...
success = 0
[ ... ]
success = 1
if (success) {
[ ... ]
}
It's pointless, so just remove it, and one clang warning
Caught by clang-analyzer
Change-Id: I7d57531c4dfb8955b813d534ad3b72b182fdbc76
Reviewed-on: http://gerrit.openafs.org/9255
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
The blockaddr iterator is initialised as part of the for loop.
Don't also initialise it immediately before.
Caught by clang-analyzer
Change-Id: I97e7ced15fe204b3b2d797abbdce8b3f9a2b0c8d
Reviewed-on: http://gerrit.openafs.org/9253
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Change f498c18a6f attempted to fix
a problem with using an inappropriate function to copy the
ktc_principal value 'principal' into the d.dumper structure element.
Originally the code read:
principal_hton(&principal, &d.dumper)
which copies the 'host' principal principal into the 'net' structure
d.dumper. However, this was changed to
principal = d.dumper
Which populates 'principal' with whatever garbage is in the d.dumper
structure.
Fix this so that the assignment is done the right way around.
Caught by clang-analyzer
Change-Id: Id9865a36b5a9351d013c695ed301b627ddc4a915
Reviewed-on: http://gerrit.openafs.org/9252
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
We don't need to maintain two copies (entryAddr and nextEntryAddr)
of the entry address - rework the while loop so we just use one,
and make clang a little happier
Caught by clang-analyzer
Change-Id: I6f5d76e114ad09a4fd3fc36b4d64f63daa9e1e78
Reviewed-on: http://gerrit.openafs.org/9251
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The 'found' sentinel in h_stateVerifyUuidHash is unused, because
as soon as we set it, we jump out to the 'done' label. Simplify the
function's logic, and remove a static analysis warning, by just
removing the variable.
Caught by clang-analyzer
Change-Id: I02e5ccf857f5d84cd24975b7a1b9d516624ecd64
Reviewed-on: http://gerrit.openafs.org/9250
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
offset is simply used as a copy of nextOffset for the GetText
function call. We don't need to initialise it to 0 at the start of
the loop (and arguably, as it is passed to the function by value,
we could just remove the copy entirely)
Caught by clang-analyzer
Change-Id: I137ea3ba1ff44d94b90287d9735db69d6ff8717d
Reviewed-on: http://gerrit.openafs.org/9249
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
We never use the value of mvFlag once the string has been restored,
so don't bother reseting it.
Caught by clang-analyzer
Change-Id: I12db6957c9b8ec3bb9c43f10d9e9754d4afa3ed7
Reviewed-on: http://gerrit.openafs.org/9248
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Rather than silently ignoring the failure of
afsconf_GetExtendedCellInfo, and then using garbage cell
configuration, just fail to start if afsconf can't parse the
config directory.
Change-Id: Ib3d26bc67844de10f7eb8c2ef555c5e607e4bf61
Reviewed-on: http://gerrit.openafs.org/9247
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Don't initialise code immediately before we assign a real value
to it various UV_ functions
Caught by clang-analyzer
Change-Id: I91d9300715d44fafd73b1a61be548589468e3209
Reviewed-on: http://gerrit.openafs.org/9246
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
If we can't start the keep alive thread, in either the LWP or
pthread versions of a code, report an error and exit instead of
carrying on regardless.
Caught by clang-analyzer
Change-Id: I0a25a236aadeedf10d3c0c129d716b1397c9a4e3
Reviewed-on: http://gerrit.openafs.org/9245
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
All of these *Ptr values are reset upon each iteration of the
while loop, so we don't need to NULL them immediately before
we go around again.
Caught by clang-analyzer
Change-Id: Iaa5ff6c7b154072e23eae272031919b424568eff
Reviewed-on: http://gerrit.openafs.org/9244
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
In commit c753d398f2 the
AFSDirectoryCB.DirOpenReferenceCount was split and the
NameArrayReferenceCount field was added. However, it failed to modify all
of the DirOpenReferenceCount checks prior to calling AFSDeleteDirEntry()
to include a check on the NameArrayReferenceCount. This patchset corrects
that oversight.
Change-Id: I8db1a68e5240088bcfeb226bd1eafac0c83a0b69
Reviewed-on: http://gerrit.openafs.org/9254
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Despite what the static analyzer thinks, ka_CellToRealm can't be
called with a NULL realm. Just add an assert to close down that
code path, and stop it from producing an error.
Change-Id: Ifc8cf7e5dca5ae29eaaa91c5b238a97197d89ee3
Reviewed-on: http://gerrit.openafs.org/9174
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
At the moment, the GetCapabilities RPC handler ignors errors from
CallPreamble or CallPostamble. Instead of silently swallowing these,
and potentially reutnring a bogus capabilities structure, make
it possible for the RPC to return failure to the caller.
Caught by clang-analyzer
Change-Id: Ic36e59e8cce8be4920f041a86d5636d54668d887
Reviewed-on: http://gerrit.openafs.org/9241
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
If GetCellInfo returns a non-zero result, catch the error, rather
than just carrying on regardless.
Caught by clang-analyzer
Change-Id: I6b9ca91c8cea2ff0d68873913abdc0daadcc0e27
Reviewed-on: http://gerrit.openafs.org/9240
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
If CopyOnWrite has already failed, and is taking the volume offline
for salvage we can't (and don't) do anything with further errors from
IH_DEC. Instead of assigning these to 'rc', just ignore them.
Caught by clang-analyzer
Change-Id: I7bcd82f124740e3ca3d11cb2b079aa7ea5751cf9
Reviewed-on: http://gerrit.openafs.org/9239
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
In lots of places scout takes the return value of a graphics
function, then decides it doesn't actually care about the result.
Get rid of the assignments, as they provide a false sense of
security.
Caught by clang-analyzer
Change-Id: I1ea8514b969777f1276b4e8f8ab946a4d36a870c
Reviewed-on: http://gerrit.openafs.org/9238
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
The switch which selects the collection number was missing a
'break', so selecting the CBSTATS collection would always fall
through to the default, error, case.
Caught by clang-analyzer
Change-Id: I354873d711c5f49ddad51f1b9fb332af91a6d13a
Reviewed-on: http://gerrit.openafs.org/9235
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
The bosserver doesn't do anything if the core file rename fails, so
don't bother storing the result code.
Caught by clang-analyzer
Change-Id: I9b1b7d77404b0fd560c7735646e5afe1fbcc0752
Reviewed-on: http://gerrit.openafs.org/9232
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>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
In the Restart RPC handler, don't assign a value to code
immediately before we use it to hold the return value of
bozo_WaitStatus.
Caught by clang-analyzer
Change-Id: I0781c57c87088cb3ba6170ca1e5c8d5053cf9001
Reviewed-on: http://gerrit.openafs.org/9231
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>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
We don't care about whether the renames succeed in SaveOldFiles,
so don't bother assigning their results to a variable
Caught by clang-analyzer
Change-Id: I0605fc71d243ef0f587706f9f3856aa4d722fb82
Reviewed-on: http://gerrit.openafs.org/9207
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
len is zeroed at the start of the next block, so don't bother assigning
tlen to it if we're not going to do anything with it.
Caught by clang-analyzer
Change-Id: Ie1cd5a4d9dd96920018f054b6edfc18c569c9807
Reviewed-on: http://gerrit.openafs.org/9206
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tidy up a lot of places where we initialise a variable, then
immediately assign a proper value to it, or store a return value
that we don't actually care about.
Caught by clang-analyzer
Change-Id: Icf0ec713dac6f2c4f0a60e8ead52a8d3e19381f0
Reviewed-on: http://gerrit.openafs.org/9205
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Fix the use of an incorrect variable as loop iterator which would have
resulted in a crash.
Caught by clang analyzer.
Change-Id: I785d06b9be0915bc540c37b43d1001a562a7cde4
Reviewed-on: http://gerrit.openafs.org/9202
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Fix a couple more errors where we assign to a variable, but never
read the result back out.
Caught by clang-analyzer
Change-Id: I78f8f1403d166c4231b0abdb607de77e9ed62a27
Reviewed-on: http://gerrit.openafs.org/9201
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
When we're cleaning up temporary volumes, we don't care whether
it succeeds or not. Don't assign code to the results of these
volume deletions, only to then discard it.
Caught by clang-analyzer
Change-Id: I81583cc82e78db38de8aad92c7c7d0c2f44eb33d
Reviewed-on: http://gerrit.openafs.org/9200
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
If lsmount or flushmount encounter an error, then they may include
the contents of parent_dir in their error message. However, in both
cases, this was freed a couple of lines earlier.
Just move the free() later, so that the contents of this variable
are still available.
Caught by clang-analyzer
Change-Id: Ideba52b7ba98f034baf923194007239a6cf0221f
Reviewed-on: http://gerrit.openafs.org/9193
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Report errors on both filehandles in up's Copy routine, rather
than just on the second one that we close.
Caught by clang-analyzer
Change-Id: Ia3aa9be91ccfca2993a4f27c291332e0b0d350f5
Reviewed-on: http://gerrit.openafs.org/9192
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Don't reset the value of 'code' when nothing else references it.
Caught by clang-analyzer
Change-Id: Ifd361ed6eb8c6b8740466f6c1a337669160874f4
Reviewed-on: http://gerrit.openafs.org/9191
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
The for loop in icl_EnumerateLogs looks up the next pointer in the
current entry after zapping it. Depending on reference counts, this
may result in us looking up freed memory.
Take a copy of the next point before zapping the current entry, just
in case.
Caught by clang-analyzer
Change-Id: If38f0af2b01c5b8ea00e68e4432c6ad5517578c8
Reviewed-on: http://gerrit.openafs.org/9190
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
We're about to exit anyway, so we don't care whether Cleanup
succeeds or not
Caught by clang-analyzer
Change-Id: I6350d60e6a5d29b8aaa272a54cf9ead47fdb5fad
Reviewed-on: http://gerrit.openafs.org/9186
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
When we're not interested in the return value of a function, don't
assign it to a variable.
Caught by clang-analyzer
Change-Id: I5b576f312376780c98c2dbe4f9b85e00d529ddd8
Reviewed-on: http://gerrit.openafs.org/9185
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Help out the static analyzer by telling it that rmt_Quit never returns
Change-Id: I5ee0d2ea444706e68af5a1298fd638e7d0d7f41d
Reviewed-on: http://gerrit.openafs.org/9184
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
checkCksum is assigned to by both sides of the if() expression, so
there's no need to initialise it to 0.
Caught by clang-analyzer
Change-Id: Id0e286943e11b6948231577085cdb0ce96bb0b97
Reviewed-on: http://gerrit.openafs.org/9183
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
If we can't initialise the ubik_client mutex, don't leak the
structure when returning an error.
Caught by clang-analyzer
Change-Id: Ib36d2ddf585a31b628e56dce1f33ee859fc835bc
Reviewed-on: http://gerrit.openafs.org/9182
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
We never do anything with the return value from select(), so don't
bother storing it into code.
Caught by clang-analyzer
Change-Id: I6e0352b74f0e90b62ad32a3ef1a9d0173bf307ee
Reviewed-on: http://gerrit.openafs.org/9181
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Don't ignore a failure from afsconf_GetExtendedCellInfo, as it will
leave buffers that we later read uninitialised.
Caught by clang-analyzer
Change-Id: Ia0c2675a3083385d011fd340f36bf13373f89feb
Reviewed-on: http://gerrit.openafs.org/9180
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
If ka_KeyCheckSum fails, typically because the key being used is bad,
catch the failure rather than just silently ignoring it.
Caught by clang-analyzer
Change-Id: Id51174fdf94356db10961690808670da372bc60e
Reviewed-on: http://gerrit.openafs.org/9179
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Remove various places where a variable is assigned to, and then the
result never read.
Caught by clang-analyzer
Change-Id: Id8b7aeb6c54b7c93093ad44df5a9fe01575f2fbe
Reviewed-on: http://gerrit.openafs.org/9172
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
In the current version of CacheStoreDCaches, the stored variable is
maintained within the for loop that iterates over the chunk list. This
means that it is reset to 0 each time we handle a new chunk.
However, this means that our progress is no longer accurately tracked,
as (bytes - stored) no longer gives the number of bytes which remain to
be transfered. In fact, as stored is zeroed with each loop iteration,
(bytes - stored) == bytes. This means that store behind is no longer
activated according to the users settings.
Prior to commit 334114ac58, the
stored variable was maintained within the outer, function, scope.
Just move it back there to restore the previous behaviour.
Caught by clang-analyzer
Change-Id: I248ed81f1331f4d3d4ed2e1206acebb0a8200762
Reviewed-on: http://gerrit.openafs.org/9237
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Even if allocating the dcache fails, there's no point zeroing the
parameters to the allocation function, as those changes aren't
visible outside of that function.
Caught by clang-analyzer
Change-Id: Ieb91b525e818b73e38b8d78a55d170d36273177c
Reviewed-on: http://gerrit.openafs.org/9234
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>
A stray $ had crept into the license string in afs_dcache.c. Fix it.
Change-Id: I1ab096aadb947cb08318a56b9ae21ed0786d3339
Reviewed-on: http://gerrit.openafs.org/9233
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>