These messages are not very useful right now. At least try to say what
host we sent an error to, so we know which host may be experiencing
some troubles as a result.
Change-Id: I8b41b46511ebd4760d5021ea2fe2011842450998
Reviewed-on: http://gerrit.openafs.org/9381
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
ih_sync_thread currently syncs files flagged as needing
synchronization in the background every 10 seconds. This practice has
caused severe data corruption on more than one occasion over the past
few years (124359, 131530). It has also been argued repeatedly that it
provides no meaningful additional on-disk consistency, so there is no
reason for it to exist even if it were error-free.
Syncing files in the background provides no guarantee on the
consistency of the file contents, since the files are not synced in
any order with respect to each other, or with respect to what
filesystem operations may be occurring in the application.
Additionally, journalling filesystems common on fileserver backends
will typically ensure some consistency after a certain amount of time
(by default, 5 seconds on ZFS and ext3+), so doing this sync ourselves
is often redundant or even counterproductive.
So, to avoid current and future issues with ih_sync_thread interacting
with other ihandle users, just get rid of it. Files flagged as needing
sync are still synced (not in the background) during IH_REALLYCLOSE.
FIXES 131530
Change-Id: I29571c82c5b7454cd834b339fd48baeb9963a87b
Reviewed-on: http://gerrit.openafs.org/8797
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Modify AFSPopulateNameArrayFromRelatedArray so that the DirectoryCB
parameter can safely be NULL. A NULL DirectoryCB input is required
to copy the entire NameArray.
Change-Id: Id125bb22df89c93e60d485e178bc7be0ab3c313e
Reviewed-on: http://gerrit.openafs.org/9340
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
The AFS_NAME_ARRAY_TAG value collided with AFS_NAME_BUFFER_TEN_TAG.
Change its definition.
Change-Id: I29ff2d4cb7f5d1afebea91cbb5c294ecedbe50a2
Reviewed-on: http://gerrit.openafs.org/9339
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
AFSCreateSymlinkCB and AFSCreateSymlinkResultCB
Used for creating a symlink to either a file or a directory.
Change-Id: Ic7dc49d48fc7ba3863752b3732c932f57d674d99
Reviewed-on: http://gerrit.openafs.org/9338
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/rxosd/Makefile sets CC=$(MT_CC).
src/config/Makefile.config sets MT_CC=$(CC).
Since both are recursive-expansion variables, this causes an infinite
loop, and make complains about it:
Makefile:25: *** Recursive variable `CC' references itself (eventually). Stop.
This patch avoids setting CC in src/rxosd/Makefile.in altogether, since
it does not appear to be necessary, as suggested by Jeffrey and Derrick.
Change-Id: Ieaa5c5ed21d83629ea713a745e76d17ac7f76ec1
Reviewed-on: http://gerrit.openafs.org/9336
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
A previous fix (git commit fb1d7491fb)
added a check for '!p' in gettoproot(), but p is always a non-NULL pointer
(in part since it's dereferenced just above in the code), so the check
is always false.
Instead, I suspect the original author intended to check for '!*p',
which this patch does.
Change-Id: I1c0a2dd1d582a6b5e82275db18474343efa679a2
Reviewed-on: http://gerrit.openafs.org/9337
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
readlink returns a non-NUL terminated string. If the string must be
terminated, we need to have space in the buffer for it. So, the
buffer passed to readlink must be 1 less than the real length of
the buffer.
Caught by coverity (#985597, #985610)
Change-Id: Id9a6f8227d756140960ac295330aaf17dca2ec03
Reviewed-on: http://gerrit.openafs.org/9329
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 extractAddr function (which turns a dotted quad into an IP
address), has a number of overflows when one or more elements of
the quad are more than 31 characters in length.
The array allocated for each portion is 32 bytes long, but we only
stop writing into the array when the indexing pointer reaches 32,
which doesn't leave us with space for the trailing NULL.
Rework this so we always allow space for the NULL, and use a #define
for the array length to make it more clear whats going on.
Caught by coverity (#985591, #985592, #985593, #985594)
Change-Id: I33ecc78ba6c90e44c3a4f2df171abba1d58562b3
Reviewed-on: http://gerrit.openafs.org/9327
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
We're checking to see if we've overflowed the array _after_ we've
looked up an element within it - so on the final iteration, we
always read past the end of the array.
Fix this by swapping the order of the tests in the for statemen
Caught by coverity (#985590)
Change-Id: Ibbf0eb88083166f0a23316edf0612e94593c07ce
Reviewed-on: http://gerrit.openafs.org/9326
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
PackageIndex++ returns the pre-index value of PackageIndex, so the
error statement isn't run when PackageIndex == MAX_PACKAGES. This
means we go on to overflow all of the arrays that are MAX_PACKAGES
in size.
Caught by coverity (#985583, #985584, #985585, #985586,
#985587, #985588, #985589)
Change-Id: If81f9ff89edc4cfd56677ff51cea71281ebe1e3b
Reviewed-on: http://gerrit.openafs.org/9325
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
cells has a maximum size of MAXCELLS. Doing cells[MAXCELLS] overflows
that array. Clamp our maximum number of cells at one below this to
avoid the overflow.
Caught by coverity (#98551)
Change-Id: I45fd8a55e31ad7ea86a996b593359536c7078891
Reviewed-on: http://gerrit.openafs.org/9324
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 hostaddrs array has MAXHOSTSPERCELL (8) available elements.
The ubik connections list has MAXSERVERS (20) elements - when copying
from the ubik list into the cellinfo hostaddrs list, be careful not
to overflow it.
Caught by coverity (#985577)
Change-Id: Ie51cb939a6e3381a285787ad125342ca7a9e7cbb
Reviewed-on: http://gerrit.openafs.org/9323
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 ubik connections array is NULL terminated, so we have to
ensure that there is enough space for the trailing NULL. As the
array is MAXSERVERS elements long, this means that we can only
store MAXSERVERS-1 connections in it.
This problem will never be encountered by the correct code, as
the number of hosts returned from afsconf_Open is capped at
MAXHOSTSPERCELL (currently 8). MAXSERVERS is currently 20. However,
fix the bug in case we increase MAXHOSTSPERCELL at some point in
the future.
Caught by coverity (#985576)
Change-Id: Icd3f4afe929cbf05522e44132f055a3955c4d23c
Reviewed-on: http://gerrit.openafs.org/9322
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Include the ResidencyRpc in the list of fs operation numbers that
can be display by xstat_cm_test.
Caught by coverity (#989029)
Change-Id: Ib8059fe53e5254d212722db59c05a0f0822883e2
Reviewed-on: http://gerrit.openafs.org/9320
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
With the recent update to the imported heimdal code, krb5_enomem
is used in a few places as a simple statement that doesn't make
use of the value. With the current definition, this triggers
compiler warnings because the statement has no effect.
Replace the definition with a static inline function that returns
the expected value.
Change-Id: I799022b69a43ab635560a1a5ea8f67f0a8f7230a
Reviewed-on: http://gerrit.openafs.org/9335
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Patchset 305133cde6 halted the practice
of calling ka_UserAuthenticateGeneral2() with the alternate smbName.
It should have halted the practice of passing flag
KA_USERAUTH_AUTHENT_LOGON which indicates that the smbName parameter
has been provided. Passing KA_USERAUTH_AUTHENT_LOGON without the smbName
field results in a KTC_INVAL error.
This error only impacts sites that still use kaserver or Kerberos v4 for
authentication.
Change-Id: I9eb7adc4fdb7b3ffa0aedca377e2f91bc01b30ea
Reviewed-on: http://gerrit.openafs.org/9318
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Make sure that we initialise the nbulkentries structure to 0 before
we start work, so that if the failure handler is called, it doesn't
try to free garbage.
Caught by coverity (#985980)
Change-Id: If55faadd44f7bbc80abbdcd7842603d586db7581
Reviewed-on: http://gerrit.openafs.org/9317
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
If an array is n elements long, accessing element array[n] is an
overflow. Fix various places where we apply loop bounds incorrectly
using the NUM_CM_STAT_ENTRIES constant.
Caught by coverity (#985571, #985573)
Change-Id: I24a53e8044d3d5d39d070909400329a82f22b6b9
Reviewed-on: http://gerrit.openafs.org/9316
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
If an array is n elements long, accessing element array[n] is an
overflow. Fix various places where we apply loop bounds incorrectly
using the NUM_FS_STAT_ENTRIES constant.
Caught by coverity (#985570, #985571, #985572)
Change-Id: I8a28f06059771f91415ebc989714929cfd09f296
Reviewed-on: http://gerrit.openafs.org/9315
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
The Lookup and Residency fs stats counters were missing from the
fsOpNames array. Add them in - Lookup has been missing since the
IBM release, Residency was missed when the MR-AFS code was merged.
This is still rather fragile, as there's no guarantee that
AFS_STATS_NUM_FS_RPC_OPS matches the number of elements in this
array. However, this is now correct until someone breaks it again...
Caught by coverity (#985569)
Change-Id: I22496050d5e786276a6646aa763d036449a3660d
Reviewed-on: http://gerrit.openafs.org/9314
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
There are actually 30 elements in the AFS_STATS_FS array. When the
ResidencyRpcs counter was added, the total number of operations
wasn't updated.
Fix this so that it is correct, although this still remains rather
fragile.
Change-Id: I92a0d2bf3741bc7aaeae837d6dcbcd30616e17ae
Reviewed-on: http://gerrit.openafs.org/9313
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
In GetMeAnEntry, we can end up overflowing the nameHash array by one
element if the stars are particularly badly aligned.
nameptr is a static across function calls, so nameptr and j are not
equal. If nameptr is increment to NHSIZE in the same loop iteration
as j reaches NHSIZE + 2, the loop will terminate. We'll then
lookup nameHash[NHSIZE], which is 1 element passed the end of the
array.
Add an if statement which loops nameptr outside the loop (in the
same way as the if statement in the loop)
Caught by coverity (#985568)
Change-Id: I47075f363fad10e8c19276359699566755779cca
Reviewed-on: http://gerrit.openafs.org/9312
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 checking whether a user supplied index into the ICL logs array
is out of bounds, we need to check whether it is greater or equal
to the maxmimum number of elements. Otherwise we can access one
more than the number of elements in the array.
Caught by coverity (#985567)
Change-Id: Id90f02eae1d5689b9b2c9a82bce0e503941387da
Reviewed-on: http://gerrit.openafs.org/9311
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
The code currently does
fgets(cmdbuf, ... );
cmdbuf[strlen(cmdbuf - 1)] = '\0';
in order to remove new lines from cmdbuf. Coverity thinks there's
a danger of strlen(cmdbuf) being 0, and thus the strlen being negative.
That shouldn't happen, but if fgets hits EOF midway through a line, we
might get a string that doesn't have a trailing '\n', and end up
removing the wrong character. Tidy this up by checking that the string
isn't 0 length, and that the character we're zapping is a newline.
Caught by coverity (#985430)
Change-Id: I8dae925debdc2473a6a51db021ce843e957a1557
Reviewed-on: http://gerrit.openafs.org/9310
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Make sure that lnames is zero'd on entry to pr_ListMembers, so that
an early error return doesn't also return garbage.
Change-Id: I78c35f0c18d9c7ec3f638c8e80609ac28d362925
Reviewed-on: http://gerrit.openafs.org/9309
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 pr_ListMembers returns an error, don't try and use the results
it provides, as they could be garbage.
Caught by coverity (#92119)
Change-Id: Idcfb464953dcdec68cba988d3fb1ab6ddad08340
Reviewed-on: http://gerrit.openafs.org/9308
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
We stopped defining the OpenAFS version in AM_INIT_AUTOMAKE a while
back. Use git-version script instead.
Change-Id: I56ef9792cf653921161e177a7c6f143a4b41ace2
Reviewed-on: http://gerrit.openafs.org/8908
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Instead of building a private copy of the ubik objects, link
against mtafsubik.lib.
Change-Id: Ic72e0ea963ddb870d082f7a3746f978ba785bbbc
Reviewed-on: http://gerrit.openafs.org/9302
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
When linking afsio many of the libraries specified in the EXELIB3
list were unnecessary. The only lib in the list that is required
is libcmd.lib. Rename EXELIB3 to LIBCMD and prune the rest.
Change-Id: I87bf0583f312d7b3dadc5581c08fedaa6b754c77
Reviewed-on: http://gerrit.openafs.org/9301
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
afsrpc.dll is supposed to be the multi-threaded dynamic loadable
version of the RX package. It has also included the RXAFS and
RXAFSCB client functions from src/fsint. Including the RXAFS* is
nice in theory but in practice the afsd_service.exe must link to
afsint.lib anyway in order to obtain access to RXAFSCB_ExecuteRequest()
which is part of the server portion. Linking to both results in
multiple instances of the same symbols in which case afsint.lib
must be linked to first and the dynamic version of the functions
are ignored.
The only other module that used RXAFS* functions from afsrpc.dll
is the adminutil library from the libadmin package. adminutil
doesn't implement the server functions but it can just as easily
link against afsint.lib.
Removing RXAFS* from afsrpc.dll results in a library that only
contains RX, RXSTATS, core xdr and rxkad.
This patchset also fixes some minor bugs:
1. $(UTILOBJS) were not being linked to the library due to
a typo.
2. Always use multi-thread safe versions of afsutil.lib
Change-Id: I5cc6d485a763d5a17735abd35d193fb7b0d280e5
Reviewed-on: http://gerrit.openafs.org/9300
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
afsauthent.dll exported:
pthread_recursive_mutex_lock
pthread_recursive_mutex_unlock
grmutex (DATA)
even though a dedicated afspthread.dll existed and all pthreaded
modules must link to afspthread.dll and not all link to
afsauthent.dll. Move these functions and the global mutex variable
to afspthread.dll to ensure that only one instance of the variable
is present in any binary.
Also remove from src/libafsauthent/NTMakefile the local building
of src/util object files and link to mtafsutil.lib.
Change-Id: I9f8e76165f9c1b1be7ed1a90cdaac03b629d9591
Reviewed-on: http://gerrit.openafs.org/9303
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
If SDISK_SendFail fails before the pathname to the temporary file
has been constructed, then the failure handler will unlink stack
garbage, with variable results.
Initialise the string, and check to see if it has contents before
calling unlink
Change-Id: I1de898d5f0f0dc608e9c9c62dc66e6b4b9fdc5bf
Reviewed-on: http://gerrit.openafs.org/9299
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 afs_NewCell fails, then we can end up releasing a lock on a
section of memory that we have already freed. As this only happens
if the memory we're operating on is newly allocated and not yet
visible to anyone else, it is safe to release the lock before
starting to tidy things up.
Caught by coverity (#986054)
Change-Id: Ie8651c61790d57a9fd7bbbafcaf78e37b8222bae
Reviewed-on: http://gerrit.openafs.org/9298
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 call _StatCleanup on a stored statent structure, it
deletes the mutex, and frees the structure itself. This means it
can't be called with a locked structure as the mutex deletion
will fail, and then we'll try to reference freed memory when we
later unlock that mutex.
Fix this by unlocking the mutex before calling _StatCleanup. This
is safe because the only reference to the structure visible to other
threads must have been deleted by the time we reach this point.
Caught by coverity (#986058, #986059)
Change-Id: I346d4c8a7cd478db044af919662c1cf1c093e205
Reviewed-on: http://gerrit.openafs.org/9297
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 we have an input file which contains a group membership line
(with a leading space) before any group definitions occur, pt_util
would use stack garbage as the group to create these members in.
Avoid this by requiring the presence of a group line before any
membership lines.
Caught by coverity (#92180, #986000, #92248)
Change-Id: I536f089d67041dbf90f35b6dfeed5ba3303318a8
Reviewed-on: http://gerrit.openafs.org/9296
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 there isn't sufficient data in the input line to satisfy sscanf,
fail with an error, rather than continuing with potentially corrupt
data.
Change-Id: I5f963b5623176ac7631693b093d23cf9f0405edc
Reviewed-on: http://gerrit.openafs.org/9295
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
krb_write_ticket_file uses a fixed length buffer to store the name
of the ticket file, but copies into this from an environment variable.
Remove the fixed length buffer, and use a mixture of the variable
itself, and dynamically allocated strings.
Caught by coverity (#985909)
Change-Id: I997fd1812c45e730db39497a27a5e168f102fee5
Reviewed-on: http://gerrit.openafs.org/9294
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Refactor the code which returns a failure from afsconf_Open into
a single section, rather than having multiple copies through out
the routine.
Change-Id: I70b3fec98321bf89e6d59055545d5d4193026d28
Reviewed-on: http://gerrit.openafs.org/9293
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 fallback to the .AFSCONF file in the user's homedirectory,
the results of getenv("HOME") are copied into a fixed length string,
without checking for overflows.
Instead of risking this, just use asprintf to dynamically construct
a string, and free it when we are done.
Caught by coverity (#985905)
Change-Id: Id8769ede841165d3ff3104143e55767d550d6f87
Reviewed-on: http://gerrit.openafs.org/9292
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Get rid of a buffer overflow in the bos_util utility, by just
printing the key from the 'tbuffer' string, rather than copying
it into 'x' which is too small for it.
Change-Id: Ia364fb63edb9e40a887e77aad833689a99b4ea7c
Reviewed-on: http://gerrit.openafs.org/9291
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
readlink fills the buffer passed to it with a non-terminated string.
It can legitimately fill the whole of this buffer. So, if we require
a string to be NUL terminated, we must give readlink one less than
the string length so that the termination character can be safely
appended.
Caught by coverity (#985611)
Change-Id: Ie6c651a9c0fd94d83bd05395204341d71e353146
Reviewed-on: http://gerrit.openafs.org/9290
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Before freeing curr_fsData, check that it is non-NULL, rather than
checking prev_fsData in error.
Caught by coverity (#985289)
Change-Id: I8fb74ce0c4e447de65924f2afb6075213d839760
Reviewed-on: http://gerrit.openafs.org/9284
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 a key is bad, have SBOZO_ListKeys return an error, rather than
silently ignoring the result from ka_KeyCheckSum.
Caught by coverity (#988413)
Change-Id: Ifacc9bac654d2632bd31731995795b786d485327
Reviewed-on: http://gerrit.openafs.org/9270
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
A part of the current ListUsedIds code is:
range = abs(startId - maxId);
if (range < 0)
range = -range;
The only way abs() could return a negative value would be if its
argument was INT_MIN (-2147483648) to begin with, because -INT_MIN
cannot be represented in two's complement. However, calling
abs(INT_MIN) is undefined behavior in C [see C99 7.20.6.1], and for
that matter, so would be computing -range (-INT_MIN) in that case,
so we could still be left with a negative range value.
Luckily, (startId - maxId) can never be INT_MIN. If startId < 0,
then maxId <= startId, so in the worst case, when maxId = INT_MIN
and startId = -1, (startId-maxId)=INT_MAX. If startId >= 0, then
maxId >= startId, so in the worst case, when maxId = INT_MAX and
startId = 0, (startId-maxId)=-INT_MAX=INT_MIN+1.
This patch removes the useless if statement.
Change-Id: Ia754fcf3e59354afb40dbbbb95623e27285a5f82
Reviewed-on: http://gerrit.openafs.org/9289
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
When reading a standard tag, make sure and catch an EOF error
from iod_getc. Otherwise we'll end up trying to parse 0xFF as a
tag length.
Caught by coverity (#985603)
Change-Id: Iae0b1bf71ed495b4f454975a1bfe3aef8fca3e9e
Reviewed-on: http://gerrit.openafs.org/9275
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
When using pt_util's ubik shim, if we're creating a new ubik label
make sure to zero the whole structure before writing it out to disk.
Otherwise we get a shorts worth of stack garbage in the resulting
file.
Caught by coverity (#986010)
Change-Id: I0abb8b7968d4f25c97dc0927d63dd01099b829b7
Reviewed-on: http://gerrit.openafs.org/9274
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The documented abbreviation '-c' for '-cell' no longer works since
the -config option was added. Add a parm alias '-c' to restore
compatibility with previous syntax.
Change-Id: Ie98e470d204ea2186a95668bba2581cf3e88f729
Reviewed-on: http://gerrit.openafs.org/9276
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>