Commit Graph

10218 Commits

Author SHA1 Message Date
Simon Wilkinson
152bda64c6 util: Don't cast returns from malloc()
malloc() returns a (void *) on all of our current platforms. So,
don't bother casting the return value before assigning it - it is
unnecessary noise.

Change-Id: I8287709413fe0e34f417936d1fc64c421fea6d28
Reviewed-on: http://gerrit.openafs.org/7472
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 09:24:08 -07:00
Simon Wilkinson
1c734bd7e5 update: Don't cast returns from malloc()
malloc() returns a (void *) on all of our current platforms. So,
don't bother casting the return value before assigning it - it is
unnecessary noise.

Change-Id: I6a33ab25b092faa96c764f0a469d052c181344ee
Reviewed-on: http://gerrit.openafs.org/7471
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 09:19:40 -07:00
Simon Wilkinson
695e3a028e sys: Don't cast returns from malloc()
malloc() returns a (void *) on all of our current platforms. So,
don't bother casting the return value before assigning it - it is
unnecessary noise.

Change-Id: I58b7695e3cf4b99f17869a46e1efca5c7daf6ff7
Reviewed-on: http://gerrit.openafs.org/7470
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 09:19:18 -07:00
Simon Wilkinson
e33f1dc0b6 xstat: Don't cast returns from malloc()
malloc() returns a (void *) on all of our current platforms. So,
don't bother casting the return value before assigning it - it is
unnecessary noise.

Change-Id: Iaddc6c44041dc77a576f32133b2aa80aefce5cb2
Reviewed-on: http://gerrit.openafs.org/7469
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 09:18:58 -07:00
Simon Wilkinson
900f7cc5f7 lwp: Don't cast returns from malloc()
malloc() returns a (void *) on all of our current platforms. So,
don't bother casting the return value before assigning it - it is
unnecessary noise.

Change-Id: Ie41f7b831f0ba70796649e2493e014fe44f1c39e
Reviewed-on: http://gerrit.openafs.org/7467
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 09:08:42 -07:00
Simon Wilkinson
3613d41515 rx: Don't cast returns from allocator
malloc() and osi_Alloc both return (void *). So, don't bother
casting the return value before assigning it - its unnecessary
noise.

Change-Id: I71a66a8fa0d9f49f4833dd77bbb55422e6f20d6f
Reviewed-on: http://gerrit.openafs.org/7466
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 09:08:18 -07:00
Simon Wilkinson
56e350b855 auth & [ak]log: Don't cast returns from malloc()
malloc() returns a (void *) on all of our current platforms. So,
don't bother casting the return value before assigning it - it's
unecessary noise.

Change-Id: I270b81c239afb9ac4bd8121adfd5a48fcfac9c3b
Reviewed-on: http://gerrit.openafs.org/7465
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 09:02:34 -07:00
Simon Wilkinson
b0ccfea010 afsmonitor & gtx: Don't cast returns from malloc()
malloc() returns a (void *) on all of our current platforms. So,
don't bother casting the return value before assigning it - it's
unecessary noise.

Change-Id: I74b1f3ba3000ecaeb3da8eb3201f6050c9972c4e
Reviewed-on: http://gerrit.openafs.org/7464
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 08:59:11 -07:00
Simon Wilkinson
cbdf31d9ff dbservers: Don't cast returns from malloc()
malloc() returns a (void *) on all of our current platforms. So,
don't bother casting the return value before assigning it - it's
unecessary noise.

Change-Id: I5a7c800e2836e7401f5f8bccf1aa2a1b223100b7
Reviewed-on: http://gerrit.openafs.org/7463
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 08:57:51 -07:00
Simon Wilkinson
4d96d0d5e4 libadmin & uss: Don't cast returns from malloc()
malloc() returns a (void *) on all of our current platforms. So,
don't bother casting the return value before assigning it - it's
unecessary noise.

Change-Id: I9a3387c07c6ee02efbaa1ec0035fcea8691f171c
Reviewed-on: http://gerrit.openafs.org/7462
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 08:56:07 -07:00
Simon Wilkinson
0df1f0023a fileserver & friends: Don't cast from malloc()
malloc() returns a (void *) on all of our current platforms. So,
don't bother casting the return value before assigning it - it's
unecessary noise.

Change-Id: I9d41f2f1aee03d9317b4c5780fb00e13d30b0821
Reviewed-on: http://gerrit.openafs.org/7461
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 08:54:33 -07:00
Simon Wilkinson
ca48be9161 backup: Don't cast returns from malloc()
malloc() returns a (void *) on all of our current platforms. So,
don't bother casting the return value before assigning it - it's
unecessary noise.

Change-Id: I6a878d53007e27179c11d8f745b09dacade4c83d
Reviewed-on: http://gerrit.openafs.org/7460
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 08:54:15 -07:00
Simon Wilkinson
0cf3c58d80 bos: Don't cast returns from malloc()
malloc() returns a (void *) on all of our current platforms. So,
don't bother casting the return value before assigning it - it's
unecessary noise.

Change-Id: If6f0dbc00b31f5d9a1622984c6ac9eba83c04900
Reviewed-on: http://gerrit.openafs.org/7459
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 08:53:54 -07:00
Simon Wilkinson
25bc7849ca JAVA: Don't cast returns from malloc()
malloc() returns a (void *) on all of our current platforms. So,
don't bother casting the return value before assigning it - it's
unecessary noise.

Change-Id: I534d424da13e03d3c0f0de3dddf1dd19088d1659
Reviewed-on: http://gerrit.openafs.org/7458
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 08:53:38 -07:00
Simon Wilkinson
cfcb45d4ae Unix CM: Don't cast allocator returns
All of our allocators return (void *) values, so there is no need
to cast the returns - doing so is just noise.

Change-Id: I6b1009efbb5034225a4af0e19d03b74c628dfb82
Reviewed-on: http://gerrit.openafs.org/7457
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 08:53:03 -07:00
Simon Wilkinson
9547615445 Don't cast the return from calloc()
calloc returns a (void *) argument. So we don't need to cast its
output before storing it.

Change-Id: Ibdfc61a8a2cf9779a0bfb17ff8ebf1f3bef3ea0e
Reviewed-on: http://gerrit.openafs.org/7456
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 08:52:28 -07:00
Simon Wilkinson
bdd8187c04 Don't cast the return from realloc()
realloc takes, and returns a (void *) argument. So we don't need to
cast these parameters into, or out of, realloc. Doing so is just
noise, so don't bother.

Change-Id: I64e721703536515b2e315e3b033eb2be14f7e18c
Reviewed-on: http://gerrit.openafs.org/7455
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 08:52:11 -07:00
Simon Wilkinson
9efc255ab8 Use calloc, rather than malloc/memset
Rather than doing
	a = malloc(sizeof(me));
	memset(a, 0, sizeof(me));

Just use
        a = calloc(1, sizeof(me));

This is simpler, shorter, and removes the potential for the size of
the memset not matching the size of the malloc (or the target of the
memset being wrong!)

Where the size is of the form (n * sizeof(me)), we also use
calloc(n, sizeof(me));

Change-Id: Ia0f75665c1031fd2982eee0e1d8c8ebe23d7fbc0
Reviewed-on: http://gerrit.openafs.org/7454
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 08:49:28 -07:00
Simon Wilkinson
d142c8f97a Don't cast arguments to free()
free(3) is defined as:

    void free(void *ptr);

so there is no need to cast the pointer argument being past to it to
(char *), (void *), or whatever other randomness happened to be floating
through the author's mind. Remove all such casts, as they are just
noise.

Change-Id: Ib7c8c259d53e9ce74fc486cb0997360044795395
Reviewed-on: http://gerrit.openafs.org/7453
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 08:49:09 -07:00
Simon Wilkinson
8961793dbb auth: Simplify DNS lookups with asprintf
Instead of allocing a maximal string, and using snprintf to
construct each possible DNS search string, just use asprintf to
construct each string. This greatly simplifies the code, and makes
it much less likely that maths errors can creep in causing buffer
overflows in the future. The downside is that we have more round
trips to the allocator, but that shouldn't matter in this context.

Change-Id: Iae9ab7d45f454c90a937354c71c9ec7fa2c55b69
Reviewed-on: http://gerrit.openafs.org/7452
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 08:48:55 -07:00
Simon Wilkinson
044785d587 Use asprintf for string construction
Rather than using something along the lines of

    strOut = malloc(strlen(strA) + strlen(strB) + strlen(strC) + 1);
    strcpy(strOut, strA);
    strcat(strOut, strB);
    strcat(strOut, strC);

use asprintf for string construction, so we can just write

    asprintf(&strOut, "%s%s%s", strA, strB, strC);

roken provides an implementation of asprintf for platforms which are
missing one.

Change-Id: Ieef9f4b65f72260c0d372cdf3865daab98733ad9
Reviewed-on: http://gerrit.openafs.org/7451
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 08:48:35 -07:00
Simon Wilkinson
bd1248ca39 Use strdup to copy strings
Where we have
    newStr = malloc(strlen(oldStr)+1);
    strcpy(newStr, oldStr);

replace these with
    newStr = strdup(oldStr);

It's shorter, clearer, and gets rid of a load of occurences of strcpy,
which some compilers are now warning is unsafe (although it isn't in
this context)

Get rid of a number of custom duplicate string functions and replace
them with strdup where the behaviour is identical

Change-Id: If800343a7d13b1ba6362d4570a2a324fa3525250
Reviewed-on: http://gerrit.openafs.org/7450
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-24 08:48:22 -07:00
Andrew Deason
47e1258480 afsd: Report fakestat correctly
A fakestat value of 1 is for -fakestat-all, and 2 is for -fakestat,
not the other way around.

Change-Id: Iedfb7b4a5223c809ace5b5f704a671e8523eb53a
Reviewed-on: http://gerrit.openafs.org/7445
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-21 17:52:33 -07:00
Andrew Deason
258a092260 afsd: Detect -dcache presence correctly
cmd_OptionAsInt will return 0 if the requested option is present and
valid.

Change-Id: Ie5154648ccb274b04617dcb8cc397ed3aa3d97e6
Reviewed-on: http://gerrit.openafs.org/7444
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-21 17:51:58 -07:00
Andrew Deason
9eb924f16c afsd: Avoid printing cacheBaseDir for memcache
cacheBaseDir is NULL when memcache is turned on; don't print it.

Change-Id: Ib75a64767a9027a9eaf0341d0ad543d023cfcad4
Reviewed-on: http://gerrit.openafs.org/7443
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-21 17:51:31 -07:00
Andrew Deason
2e2bc535bd afsd: Avoid dir interpolation for memcache
memcache doesn't make use of fullpn_DCacheFile, fullpn_VolInfoFile,
etc. Do not even try to generate these strings for memcache, since
cacheBaseDir will be NULL, and so this can cause a segfault on some
platforms including Solaris.

Change-Id: I0decdb9a8866272adf500125af7edb03c98e6bdc
Reviewed-on: http://gerrit.openafs.org/7442
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-21 17:51:07 -07:00
Andrew Deason
6f6c799c4b afs: Add some comments explaining 'needvalid'
Add some comments to try and help explain the meaning of the
'needvalid' parameter to GetDSlot, added in
1a672914ab.

Change-Id: I4f1c704fa131df07e671f46b1b7575fbf607fce4
Reviewed-on: http://gerrit.openafs.org/7429
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-21 17:50:12 -07:00
Andrew Deason
cfae6cda3f Revert "afs: the assert seems to be inverted when using memcache"
This reverts commit bc7f10130f.

Change-Id: Ie4f4a103177f0485fc1196acfe4203ce06b6ce15
Reviewed-on: http://gerrit.openafs.org/7428
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-21 17:49:47 -07:00
Chas Williams (CONTRACTOR)
bc7f10130f afs: the assert seems to be inverted when using memcache
needvalid will always be 1 for the memory cache -- i.e. the slots are
always valid.  see change id I53ea6e99649e4d6d5cbde58929dfcee1d45a3e7b.

Change-Id: Id1294d54cb5f20d226258e5da39fb4d4f782a694
Reviewed-on: http://gerrit.openafs.org/7421
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-21 10:09:02 -07:00
Mark Vitale
33eff6597f vos: volume lock not released on convertROtoRW error
If an error occurs during convertROtoRW, the volume lock may
not be released.

Change-Id: Ic03af00676de836cade4e39a743b234a0dc9b6cf
Reviewed-on: http://gerrit.openafs.org/7389
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-21 10:08:48 -07:00
Mark Vitale
38ebd79baf vos: convertROtoRW does not respect volume lock
vos convertROtoRW was not checking the return code from
ubik_VL_SetLock().

Change-Id: I651c543f9a0070a9d34d9cca7583437e50e95dc8
Reviewed-on: http://gerrit.openafs.org/7388
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-21 10:08:30 -07:00
Jeffrey Altman
3a7dbe3315 Windows: avoid deadlock TreeLock vs Fcb Resource
Cannot call AFSPerformObjectInvalidate directly because
ObjectInfoCB->Specific.Directory.DirectoryNodeHdr.TreeLock is
held during the sequence

  AFSVerifyEntry->AFSValidateDirectoryCache->AFSVerifyDirectoryContent

and AFSPerformObjectInvalidate requires the Fcb->NPFcb->Resource
which must be held prior to the TreeLock.

Change-Id: I337f52e2927c8e5ae2d218867987625c3240a792
Reviewed-on: http://gerrit.openafs.org/7423
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-21 07:26:01 -07:00
Jeffrey Altman
564c9733e5 Windows: buf redir queue mgmt scp can be null
buf_InsertToRedirQueue, buf_RemoveFromRedirQueue, and
buf_MoveToHeadOfRedirQueue can be passed a NULL cm_scache_t pointer.
If the pointer is NULL (as is the case during buf_Init() processing)
the scp->redirMx must not be obtained or a crash will occur.

Change-Id: I157091afd973a8b4789976c42de253831a2698a3
Reviewed-on: http://gerrit.openafs.org/7422
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-19 13:48:08 -07:00
Jeffrey Altman
e04f324b5d Windows: Apply MAX_FID_COUNT to AFS Redirector
Provide consistency between the SMB path parser and the AFS
redirector path processing by using the same constant, MAX_FID_COUNT,
for both.  MAX_FID_COUNT is the maximum number of unique file ids
that can exist in a path after all mount points and symlinks have
been expanded.  The current value is 512.

Change-Id: Ife1a29ce7c064c986589bc9e2836899864da2f76
Reviewed-on: http://gerrit.openafs.org/7412
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-16 18:21:00 -07:00
Jeffrey Altman
94f96c6aae Windows: AFSTearDownExtents may experience active extents
If there are extents with a non-zero ActiveCount when AFSTearDownExtents()
is executed, it must leave them alone and attached to the File Control
Block.  This has implications for its callers, especially AFSCleanupFcb()
since it may be the case that a Cleanup cannot be completed.

The AFSPrimaryVolumeWorker thread must therefore check after calling
AFSCleanupFcb() whether or not the Fcb ExtentCount is zero before
calling AFSRemoveFcb().

Change-Id: I164dbe24d2bfe69aba0fcb5d845f66415d5bb0c3
Reviewed-on: http://gerrit.openafs.org/7406
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-16 18:20:43 -07:00
Jeffrey Altman
a9a768fb7a Windows: avoid duplicate work cm_Analyze
During VNOVOL processing, if the volume is replicated and the
server reference status is "not busy", set the status to busy
and avoid calling cm_SetServerBusyStatus() because that function
mirrors the loop that is already being processed.

Change-Id: I1c92fd02fecc92c3dcd94a33eb87fe5c2fa254ae
Reviewed-on: http://gerrit.openafs.org/7411
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-16 06:03:30 -07:00
Mark Vitale
9a728fd86c vos: convertROtoRW may create two RW volumes
If the RW volume is listed after the RO convert target in the VLDB,
the code failed to detect that an RW is already present and would
create a second RW volume.

Change-Id: Ia77004214c4d1b18699b5527bc1fc928e8e1143d
Reviewed-on: http://gerrit.openafs.org/7385
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-16 05:40:49 -07:00
Jeffrey Altman
97581f7510 Windows: init section ptrs for pioctl files
FIXES 130783

Change-Id: I809d21d5d30727172d6e1026d99b32466fcc74c6
Reviewed-on: http://gerrit.openafs.org/7407
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-15 16:58:45 -07:00
Jeffrey Altman
ac08a0c30d Windows: Redir Ioctl thread safety
A crash dump showed that it is possible for a Cleanup
to race with a Read from the ioctl file.  Add reference counting
to protect against crashing under such a circumstance.

Change-Id: I5dada2b5855603807b48a191db46ff48043c1997
Reviewed-on: http://gerrit.openafs.org/7405
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-15 16:58:25 -07:00
Jeffrey Altman
a160606616 Windows: Permit Media Player to work with mapped drives
Windows Media Player was failing to play media files from
mapped drives if the mapping was to a directory several
levels below \\afs\cellname\.  The code to permit SUBST drive
letters to work got in the way during NPGetConnection processing.
Try to get the connection info without the drive substitution
logic.  Try again with the drive substitution if the result
is no connection present.

FIXES 130757

Change-Id: I0c2037d1d8f4c6cf82fbff7d4baee995b5124b39
Reviewed-on: http://gerrit.openafs.org/7402
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-15 16:58:08 -07:00
Michael Meffie
dfceff1d3a volser: preserve stats over reclones and restores
Optionally, preserve the volume usage statistics instead of clearing
them during reclone and restore operations.

Change-Id: I436b39b129b892912533ddeff5569b07224b075c
Reviewed-on: http://gerrit.openafs.org/3312
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-05-12 06:33:26 -07:00
Mark Vitale
e1c6ad7d58 vos: convertROtoRW misc error reporting problems
Fixes a few inconsistencies and bugs in some error messages.

Change-Id: Ic4971c4cc3a3aa3623ee0f13161fd7793d3acb19
Reviewed-on: http://gerrit.openafs.org/7387
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-05-12 06:33:15 -07:00
Simon Wilkinson
0f30c95a03 cmd: Add support for pulling options from files
With this change, we gain the ability to set our command line options
from krb5.conf configuration files. This is only available for tools
which are implemented using the new cmd_OptionAs accessor methods.

Callers should load their configuration file using
    cmd_OpenConfigFile("/path/to/config/file.conf");

(an addition to libauth to return a path to a system wide
 configuration file will be forthcoming)

and then set their command name (for example, "fileserver", "afsd",
"vos" and so on) using
    cmd_SetCommandName("mycommand");

The accessor functions will then populate their return values with
either:
  a) The command line options, if specified
  b) The contents of the tag matching the option name, in the
     [command_subcommand] section of the configuration file, if it
     exists
  c) The contents of the same tag, in the [command] section of the
     configuration file, if it that exists.
  d) The contents of the same tag in the [defaults] section of the
     configuration file.

Callers can also gain access to the entire configuration file by
calling cmd_RawFile, or to just the section corresponding to their
command line by calling cmd_RawSection. Note that when using the file
directly, it is up to callers to preserve consistency by implementing
similar inheritance rules as the above.

Change-Id: Ic501ab296af3638f961486869af79c9ce47b77b8
Reviewed-on: http://gerrit.openafs.org/7135
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-05-11 18:49:07 -07:00
Simon Wilkinson
ad347dea32 tests: Add additional cmd tests
Add additional tests to the libcmd test suite to verify the
behaviour of cmd_OptionPresent and cmd_OptionAsList

Change-Id: I81a235fb5ee87682c72ca942f1341f77be6fda39
Reviewed-on: http://gerrit.openafs.org/7392
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-05-11 18:49:00 -07:00
Derrick Brashear
0524e0d191 macos: update AFS prefs pane
modify afshelper to just run what it's told instead
of offering fixed operations. this avoids having a setuid
tool around. in spite of apple's suggestion this is correct,
it's actually more dangerous. instead, elevate privilege only
to run a small set of commands, then drop. allow
unlocking of the prefs pane, but make the menu extra prompt
for authentication when needed.
deactivate controls in the prefs pane when locked.

Change-Id: I0e2510efc98605f464e04d26cc8f2ce2bfe116f4
Reviewed-on: http://gerrit.openafs.org/7196
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-11 17:21:19 -07:00
Andrew Deason
0debf2d227 Call rx_SetNoJumbo earlier
For ubik server processes, rx_SetNoJumbo needs to be called before
ubik initialization for it to effect the communication between
dbservers; otherwise, full database transfers may result in Rx
jumbograms on the wire regardless of the jumbo/nojumbo setting. Move
the call to rx_SetNoJumbo to before ubik initialization to avoid this.

Also move the call to rx_SetNoJumbo to immediately after rx_Init* for
all server processes, for consistency. Move similar calls to
rx_SetMaxMTU for the same reason.

Change-Id: Ic79415829601fcfb4e74e72fbf5711d0c32aaa0c
Reviewed-on: http://gerrit.openafs.org/7350
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-11 17:20:05 -07:00
Mark Vitale
a2f523b505 DOC: vos convertROtoRW security requirements
They were copied from another command; corrected them.

Change-Id: Ic77f1a91520ec4147e42864438d98942f6a7effc
Reviewed-on: http://gerrit.openafs.org/7305
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-11 17:19:11 -07:00
Ken Dreyer
186158c9eb doc: add Windows section to fs newcell
fs newcell works slightly differently on Windows. Document the
differences in the man page.

FIXES 125094

Change-Id: I3fb71ebb28290222069d795762f50a82f3fb6495
Reviewed-on: http://gerrit.openafs.org/6919
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-11 17:18:44 -07:00
Andrew Deason
ecfd9549fc vol: Free vol header on attach_volume_header error
In attach_volume_header, make sure we free the volume's header if
we're returning an error. We take care of the locks and i/o handles in
the immediately preceding block, but for an actual error we don't get
rid of the header. Do so.

Noticed by Tom Keiser.

Change-Id: I97e61700f644066ac1a0e6b45a67dd62c5397034
Reviewed-on: http://gerrit.openafs.org/7325
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-11 17:14:56 -07:00
Simon Wilkinson
f45ed29d5f Make the cmd config file parser build on Windows
Change-Id: Id6c3515869529b6fb5c48a06661b63bed974e436
Reviewed-on: http://gerrit.openafs.org/7141
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-11 16:40:55 -07:00