Commit Graph

12318 Commits

Author SHA1 Message Date
Michael Meffie
ce51d19286 readme: remove README.PTHREADED_UBIK
We enabled pthreaded ubik by default in commit 27cb0d3888,
and it is no longer considered beta or experimental.  There is no longer
a need for separate documentation of it, and adjust the options
listing in INSTALL accordingly.

[kaduk@mit.edu: adjust for the changed default behavior.]

Change-Id: Ib1315e55c1e00bdae0f55f0f8446f5a2c3d9671f
Reviewed-on: http://gerrit.openafs.org/10978
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-08-17 22:17:25 -04:00
Michael Meffie
9a77af6d22 readme: Rename README to INSTALL
Create a new top level README to introduce OpenAFS.

Move the old README to a file called INSTALL for information about
building and installing OpenAFS on various platforms.

Change-Id: Id8853de73f669a6d5497cafd65a1e98b309c6efc
Reviewed-on: http://gerrit.openafs.org/10976
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-08-17 22:11:07 -04:00
Michael Meffie
f61beda6d6 readme: move the LICENSE file to the top level directory
Move the LICENSE file to the top directory to make it
more visible and to clean up the src directory.

Update the top level make file and redhat packaging
to accomodate the new path to the LICENSE file.

Change-Id: I64b655584cf61b8a45c6d6788a84aff31df8e83e
Reviewed-on: http://gerrit.openafs.org/10972
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-08-17 22:10:05 -04:00
Jeffrey Altman
c9f430fd8f vlserver: ListAttributesN2 volume name safety
The vlserver ListAttributesN2 RPC permits filtering the result set
by volume name in addition by site or volume id.

Two issues identified by Andrew Deason (Sine Nomine Associates) are
addressed by this patch.  First, the size of the volumename[] buffer
is insufficient to store the valid input read over the network.  The
buffer needs to be able to store VL_MAXNAMELEN characters of the volume
name, two characters for the regular expression '^' and '$', and the
trailing NUL.

Second, sprintf() is used to write to the buffer and even with valid
input from the caller SVL_ListAttributesN2 can overflow the buffer
when ".backup" and ".readonly" are appended to the volume name.  If
there is an overflow the search name is invalid and there can not be
a valid match.

This patch increases the size of volumename[] to VL_MAXNAMELEN+3.

It also uses snprintf() instead of sprintf() and performs error
checking.  The error VL_BADNAME is returned when the network input is
invalid.

Change-Id: Id65b83e0dd14c6f41af73c6868975ae53c4975a7
Reviewed-on: http://gerrit.openafs.org/11969
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Nathaniel Filardo <nwfilardo@gmail.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2015-08-05 10:44:56 -04:00
D Brashear
049323e7e0 vlserver: limit use of regex to admins always
allow regexes only if the querying user is a superuser.
if the superuser uses up all the resources, well, they could just do
whatever damage directly anyway. means even in unrestricted mode
we are not vulnerable

Change-Id: Ib35d649f31e752ba5ae8373a06b67ea76f97425c
Reviewed-on: http://gerrit.openafs.org/11968
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2015-08-05 10:44:48 -04:00
Jeffrey Altman
fc43236872 Revert "vlserver: Disable regex volume name processing in ListAttributesN2"
This change reverts commit 22481ab370 which
by disabling regex queries of volume names breaks some backup software
including TSM.

Change-Id: Ic8b398e289845b45b6b073729e9a091c8b5d71b5
Reviewed-on: http://gerrit.openafs.org/11967
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
2015-08-05 10:44:39 -04:00
Anders Kaseorg
682d5e7434 kas: remove @CFLAGS_NOERROR@ in favor of specific pragma
Change-Id: Icf07c63a0e5a59da19a9db4edf7ac3c346349088
Reviewed-on: http://gerrit.openafs.org/11966
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2015-08-02 22:58:17 -04:00
Anders Kaseorg
7254d831b7 tests/volser/vos-t.c: Don’t ignore return value of pipe
Resolves this warning:

vos-t.c: In function ‘TestListAddrs’:
vos-t.c:60:5: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]
     pipe(outpipe);
     ^

Change-Id: I7eb58a91b5a7d9df18a4952400f74c79299e857d
Reviewed-on: http://gerrit.openafs.org/11958
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2015-08-02 22:03:44 -04:00
Anders Kaseorg
5a0603ced2 tests/opr/jhash-t.c: Fix unsigned constant warning
Resolves this warning on 32-bit GCC:

jhash-t.c: In function ‘main’:
jhash-t.c:60:4: warning: this decimal constant is unsigned only in ISO C90
    is_int(3704403432, opr_jhash(test, 2, 0),
    ^
jhash-t.c:62:4: warning: this decimal constant is unsigned only in ISO C90
    is_int(3704403432, opr_jhash_int2(test[0], test[1], 0),
    ^

Change-Id: Ie3ab0f5aacdc719fa63f32e545b5863ec351f5eb
Reviewed-on: http://gerrit.openafs.org/11961
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2015-08-02 21:59:41 -04:00
Anders Kaseorg
540050bbc8 Squash a frightening number of warnings from XBSA-related code
Mostly missing prototypes and mismatched format strings, but also some
more disturbing bugs.

Change-Id: I9a10728c7da645bb562374a3598414484de33f4d
Reviewed-on: http://gerrit.openafs.org/11960
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
2015-08-01 23:41:16 -04:00
Anders Kaseorg
8f78afa65b Add XBSA_XLIBS to XLIBS after it’s computed
Commit 353aa7ef2c (after 1.6 was
branched) reordered things such that XBSA_XLIBS was being added to
XLIBS before it was computed, which caused link failures with
--enable-tivoli-tsm.

Change-Id: I791add1b916c845d975d1ee21652c13244c50736
Reviewed-on: http://gerrit.openafs.org/11959
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2015-08-01 23:11:42 -04:00
Anders Kaseorg
ac39d879f8 tests/opr/time-t.c: Use labs instead of abs for long argument
Resolves this warning with clang:

time-t.c:46:8: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause
      truncation of value [-Wabsolute-value]
    ok(abs(osTime - osNow) < 2, "opr_time_Now returns a reasonable value");
       ^
time-t.c:46:8: note: use function 'labs' instead
    ok(abs(osTime - osNow) < 2, "opr_time_Now returns a reasonable value");
       ^~~
       labs

Change-Id: Ib98069e1349161d936c8ada0e69f9b33d2f71ce3
Reviewed-on: http://gerrit.openafs.org/11965
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2015-08-01 23:05:26 -04:00
Anders Kaseorg
09bf3ebb26 src/kauth/krb_udp.c: Remove redundant NULL check for array address
Resolves this warning with clang:

krb_udp.c:302:13: warning: address of array 'tentry.misc_auth_bytes' will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (tentry.misc_auth_bytes) {
        ~~  ~~~~~~~^~~~~~~~~~~~~~~

Change-Id: I0656b055090654eada2cd63476330fb288490acc
Reviewed-on: http://gerrit.openafs.org/11964
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2015-08-01 23:03:55 -04:00
Anders Kaseorg
38bd5def2a rfc3961: prototype _krb5_internal_hmac
Resolves this warning:

src/external/heimdal/krb5/crypto-arcfour.c: In function ‘_oafs_h__krb5_HMAC_MD5_checksum’:
src/external/heimdal/krb5/crypto-arcfour.c:82:5: warning: implicit declaration of function ‘_oafs_h__krb5_internal_hmac’ [-Wimplicit-function-declaration]
     ret = _krb5_internal_hmac(context, c, signature, sizeof(signature),
     ^

Change-Id: I10f028b8a0e1756cb1f1638a061616db0e76779e
Reviewed-on: http://gerrit.openafs.org/11953
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2015-08-01 22:47:10 -04:00
Anders Kaseorg
f5a35b240b make distclean: clean doc/xml/*/Makefile
These files are conditionally generated by configure.ac.
(Conditionally is okay because this is an ‘rm -f’ line.)

Change-Id: I7ade07e09b5e378b2abf6481dc8ffac26b574eed
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/11952
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2015-08-01 14:10:23 -04:00
Anders Kaseorg
8d75f24aae libadmin: #define UBIK_LEGACY_CALLITER 1 in afs_kasAdmin.c
Replaces this warning:

afs_kasAdmin.c: In function ‘GetPrincipalLockStatus’:
afs_kasAdmin.c:710:6: warning: implicit declaration of function ‘ubik_CallIter’ [-Wimplicit-function-declaration]
      ubik_CallIter(KAM_LockStatus, kaserver->servers, UPUBIKONLY,
      ^

with these marginally less alarming warnings:

In file included from ../adminutil/afs_AdminInternal.h:17:0,
                 from afs_kasAdmin.c:21:
/home/anders/wd/openafs/include/ubik.h:627:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 extern afs_int32 ubik_CallIter(int (*aproc) (), struct ubik_client *aclient,
 ^
/home/anders/wd/openafs/include/ubik.h:632:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 extern afs_int32 ubik_Call_New(int (*aproc) (), struct ubik_client
 ^

Change-Id: I49dbc5f6bb9199764c73c6ee8449d62518f377e6
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/11954
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-08-01 00:39:12 -04:00
Andrew Deason
22481ab370 vlserver: Disable regex volume name processing in ListAttributesN2
For the interim and until it is needed, this is most prudently
simply disabled.

FIXES 131890

Change-Id: Ib52da4ba38b579e51a0d8571e2da1307ae50a06f
2015-07-29 18:25:32 -04:00
Mark Vitale
8ce4a39052 Solaris: setpag should verify that ngroups will not overflow
Our ngroups management (since PAGs are still encoded as 2 groups) needs
to ensure that we do not overflow what we are prepared to handle,
and do not panic due to misheld mutexes if we have to return an error
when handling it.

FIXES 131878 (CVE-2015-3286)

Change-Id: I044d5e7d3161de815b3c2dace9c211fbb4b51ffa
2015-07-29 18:25:24 -04:00
Andrew Deason
ef671f497e afs: Use correct output buffer for FSCmd pioctl
MRAFS added the FsCmd pioctl for passing messages to the fileserver;
a bug causes it to write into the wrong memory and potentially panic
clients.

FIXES 131896 (CVE-2015-3285)

Change-Id: Ic3a81fe06edc886f24bbc0537ea53e994b086c9e
2015-07-29 18:25:17 -04:00
Daria Brashear
592a99d6e6 afs: Clear pioctl data interchange buffer before use
Avoid leaking data in pioctl interchange buffers; clear the memory
when one is allocated.

FIXES 131892 (CVE-2015-3284)

Change-Id: I880bbaa75b07b491a08c62fb17527b9fff47ec8c
2015-07-29 18:25:13 -04:00
Daria Brashear
62926630a8 bos: Use crypt for commands where spoofing could be a risk
bos defaults to not requiring crypt in a lot of cases, instead using clear.

As the simplest way to secure the channel is to enable crypt, do so.

FIXES 131782 (CVE-2015-3283)

Change-Id: I354fcbb5db37db225391a47b59d99518d1d0b2f9
2015-07-29 18:25:07 -04:00
Daria Brashear
415a2aad4c vos: Clear nvldbentry before sending on the wire
Don't leak stack data onto the wire. Clear nvldbentry before use.

FIXES 131907 (CVE-2015-3282)

Change-Id: I18ea2c6ce21b6462277d067de329f4fb44dfb3ae
2015-07-29 18:25:03 -04:00
Michael Meffie
656aaacd01 vos: changeaddr refuse to change mh entries without -force
Add a client side check to vos changeaddr -oldaddr -newaddr
to refuse to change multihomed server entries, unless -force
is given.

Change-Id: I1428e94f0c2fc19bb6ba3b2c53468f4587283bbc
Reviewed-on: http://gerrit.openafs.org/11638
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2015-07-24 00:29:32 -04:00
Marc Dionne
6c3ac6dc1e Linux 4.2: Changes in link operation APIs
The follow_link and put_link operations are revised.
Test for the new signature and adapt the code.

Change-Id: I2834589cbe36c41924ab0505e6ca4ecd797a57fd
Reviewed-on: http://gerrit.openafs.org/11928
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-07-23 10:54:31 -04:00
Marc Dionne
c2c0b6bc86 Linux: Add AC_CHECK_LINUX_OPERATION configure macro
Add a new macro to check the signature of a particular
operation against a provided typed argument list.
One of the arguments is an arbitrary label that is used
to construct the pre-processor define name.  This will
allow for testing of different forms for the same
operation.

This can be used to replace many of the remaining odd
checks in src/cf/linux_test4.m4.

Change-Id: Ic619ace54f81aa8e1eb744e2d11f541a303b9587
Reviewed-on: http://gerrit.openafs.org/11927
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-07-23 10:54:15 -04:00
Marc Dionne
89aeb71a3e Linux 4.2: total_link_count is no longer accessible
The value is now stored in the nameidata structure which
is private to fs/namei.c, so we can't modify it here.

The effect is that using a path that contains 40+ directories
may fail with ELOOP, depending on which directories in the
path were previously used.  After a directory is accessed once
its D_AUTOMOUNT flag is reset and it will no longer count
against the symlink limit in later path lookups.

Change-Id: I90e4cb0e9004b075bff2330d165c67b7a923193f
Reviewed-on: http://gerrit.openafs.org/11926
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-07-23 10:54:00 -04:00
Marc Dionne
e597b87967 Linux 4.2: Pass namespace to sock_create_kern
sock_create_kern gains an additional network namespace
argument.

Pass in the default system namesapce.

Change-Id: I640e9497510242788e5060759779785ffb563a81
Reviewed-on: http://gerrit.openafs.org/11925
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-07-23 10:53:39 -04:00
Michael Meffie
4ef47f787a doc: bosserver runs in the background
Since OpenAFS 1.0 bosserver automatically puts itself into the
background and removes it's controlling terminal. Update the examples in
the Admin and Quick Start Guides to remove the unneeded '&' on the
command line to start the bosserver.

Change-Id: I1fd8f31c604004b099d50ffe166262b4d0d58804
Reviewed-on: http://gerrit.openafs.org/11906
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-06-26 09:37:56 -04:00
Michael Meffie
73e080cbb0 tests: fix typo in softsig test helper
Change-Id: I74183a04b54b70bf3593a53fdb5f164cbd6c3b98
Reviewed-on: http://gerrit.openafs.org/11893
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2015-06-20 21:09:25 -04:00
Daria Brashear
683ea4a983 vos: desupport -stayonline
roll back -stayonline support for volume releases for now.

Change-Id: I5b4de15892f975514ea699994cb7c1da17ac83c2
Reviewed-on: http://gerrit.openafs.org/11787
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-06-16 13:51:59 -04:00
Michael Meffie
82e02157fe libafs: reset all the volumes with fs flushall
Fix a logic bug in fs flushall in which only the first volume in each
hash chain is reset (invalidated).  Instead, reset all the volumes in
the volume hash.

This bug was introduced in commit 4197bbecd9
(libafs: fs flushall for unix cm)

Also, when flushing a single volume with fs flushvolume, don't bother
searching all the hash chains, instead start on the hash chain
containing the volume being flushed.

Change-Id: I7be67fdb310b4845d02dc916f4400f83cc649cb8
Reviewed-on: http://gerrit.openafs.org/11892
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-06-13 12:28:53 -04:00
Benjamin Kaduk
0b8e85c1f9 pagsh: do not call set[ug]id()
Supposedly calling setuid(getuid()) and setgid(getgid()) would
help pick up a new group list on some systems, in the depths
of history.  In the absence of reason to believe this is still
the case, drop the calls to avoid scary warnings about unchecked
return values.

Change-Id: I39e87a27fb52f5a6868b867c9325d4a5fa93ef58
Reviewed-on: http://gerrit.openafs.org/11759
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-06-12 09:43:29 -04:00
Benjamin Kaduk
c6ec6410af Avoid unsafe scanf("%s")
Reading user input into a fixed-length buffer just to check the
first character is silly and an easy buffer overrun.  gcc on
Ubuntu 13.03 warns about the unchecked return value for scanf(),
but scanf("%s") is guaranteed to either succeed or get EOF/EINTR/etc..

In any case, we don't need to use scanf() at all, here -- reuse an
idiom from BSD cp(1) and loop around getchar to read the user's
response, eliminating the fixed-length buffer entirely.  A separate
initial loop is needed to skip leading whitespace, which is done
implicitly by scanf().

Change-Id: Ic5ed65e80146aa3d08a4b03c213f748ef088156b
Reviewed-on: http://gerrit.openafs.org/11758
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-06-12 09:43:05 -04:00
Benjamin Kaduk
74ffe9bc78 afs: Do not supply bogus poll vnodeops for FBSD
We currently provide one which just always returns 1, but the
kernel provides a vop_nopoll which conceptually is the same thing.
That one, however, provides some feature checks and fails when
consumers ask for fancy features that are not portable.

Change-Id: Iba03904aac2883e18a1abdd4f09289b6c6f907c0
Reviewed-on: http://gerrit.openafs.org/11882
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-05-29 07:41:40 -04:00
Benjamin Kaduk
c19cadbf6a Ignore return values more harder
Building on Ubuntu 14.04 with gcc 4.8.2-19ubuntu1, we encounter
fatal warnings about unchecked return values in uss, which is
now always built, as of 00a33b26d7.

Change-Id: I997dcb683e33902c2765121c70bdcf21e9d5e892
Reviewed-on: http://gerrit.openafs.org/11757
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-05-29 07:29:42 -04:00
Marc Dionne
95b857399d Linux: mmap: Apply recursion check only to recursion cases
The CPageWrite flag was originally added to prevent a scenario
where a thread doing "writepage" would realize that the cache
was too full and that some of its contents need to be written
back to the server.  Before writing back it would ask the OS to
flush any dirty VM associated with the vcache entries that are
to be written, to make sure the data is not stale.  This flush
could itself trigger writeback, leading to deadly recursion.
One such scenario is a process doing mmap writes to a file larger
than the cache.

With some kernel versions and some callers of writepage, this
can cause the mapping to be marked as being in an error state,
leading to EIO errors passed back to user space.

Make the recursion check more specific to only bail when the
calling thread is one that was originally seen writing.  A list
of current writers is maintained instead of a single state flag.

This lets other threads (like the flusher thread) go on with
writeback to the same file, and limits the WRITEPAGE_ACTIVATE
return case to call sites that can deal with it.

In testing this helps avoid EIO errors when writing large
chunks of data through mmap.

Thanks to Yadav Yadavendra for extensive analysis and testing.

Change-Id: Ic3136d7050c62e3ffac5e52441171f322b60fe86
Reviewed-on: http://gerrit.openafs.org/11124
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2015-05-26 14:37:59 -04:00
Simon Wilkinson
cb0081604e opr: Add new softsig implementation
Signals and pthreaded applications are a poor match. OpenAFS has had
the softsig system (currently in src/util/softsig.c) in an attempt to
alleviate some of these problems. However, that implementation itself
has a number of problems. It uses signal functions that are unsafe in
pthreaded applications, and uses pthread_kill within its signal
handlers. Over the years it has been responsible for a number of
portability bugs.

The old implementation continues to receive signals in the main thread
of the application. However, the handler code is run within a seperate
signal handler thread. When the main thread receives a signal a stub
handler is invoked, which simply pthread_kill()s the signal handler
thread.

The new implementation simplifies things by only receiving signals in
the handler thread. It uses only pthread-compatible signal functions,
and invokes no code from within async signal handlers.

A complete test suite is supplied.

Change-Id: I4bac68c2f853f1e7578b54ddced3833a97dd3f82
Reviewed-on: http://gerrit.openafs.org/6947
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
2015-05-26 14:06:18 -04:00
Benjamin Kaduk
b8648dbefb afsio: switch BreakUpPath to strdup
The current version of BreakUpPath is slightly broken, since
commit 4e68282e26 -- it has two
output parameters but takes only one length parameter for the
size of the output buffers passed in.  The callers ended up using
the shorter of the buffer lengths in question, so there is not
a risk of a buffer overrun, but long paths would not be properly
handled.

There is not really any need to pass in a length at all, since
what is going on is conceptually strdup, and there is no real
need to use strlcpy at all.  Make the change from strlcpy to
str(n)dup, and adjust callers to free the outputs as appropriate.

While here, convert writeFile() to use goto and a cleanup handler
to avoid leaks.

Change-Id: Ib742cb73a6d70aa863c8d30423416887b977677b
Reviewed-on: http://gerrit.openafs.org/11874
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
2015-05-26 13:58:35 -04:00
Daria Brashear
9076cbd58d Add defines for recent darwin sysctl constants
These were accidentally omitted from commit
ab9bb6363c.

Change-Id: Ic3374484eb79fe44a4032def1484c9ed733f9422
Reviewed-on: http://gerrit.openafs.org/11875
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2015-05-22 11:39:03 -04:00
Marc Dionne
5c1237432e Linux 4.1: Don't define or use ->write directly
We no longer have to define a ->write operation, and we can't
expect the underlying disk cache filesystem to have one.  Use
the new __vfs_read/write helpers that will select the operation
to use based on what's available for that particular filesystem.

Change-Id: Iab923235308ff57348ffc2dc6d718dd64040656b
Reviewed-on: http://gerrit.openafs.org/11849
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-05-20 08:56:36 -04:00
Marc Dionne
fcfa5ae246 Linux 4.1: No need for do_sync_read
Make the test here a bit more specific. do_sync_read no longer
exists, but we don't use it for new kernels.  Trying to define it
here in terms of generic_file_read is not helpful as that doesn't
exist anymore.

Change-Id: Iffb059716165436c3439e66db15002cdec5dfc16
Reviewed-on: http://gerrit.openafs.org/11848
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-05-20 08:56:19 -04:00
Benjamin Kaduk
810f0ccd03 kauth: fix clock skew detection
Commit 5b3c104296 changed/removed some
uses of abs() on unsigned time values. While the previous use of abs()
was indeed incorrect, the result wasn't necessarily much better, even
though it built with recent compilers, since it only checked for skew
in one direction.

Define and use a  macro to correctly evaluate the conditionals in 64-bit
precision, avoiding C's integer promotion rules which prefer unsigned types
(Date) to signed types of the same width (time_t on 32-bit systems).

Change-Id: Ifcbe59e73942a52a8635cb0f43cce94fdeea85a3
Reviewed-on: http://gerrit.openafs.org/11850
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-05-06 18:16:19 -04:00
Perry Ruiter
abca1fefc0 afsd: Update list of supported flags
afsd.c starts with a block comment listing the flags supported by the
afsd command.  As the code has evolved this list has not been kept up
to date.  Bring the list up to date.  Some obsolete options no longer
have any backing code.  These are marked OBSOLETE.  Some obsolete
options have code that says they are now deprecated.  These are
marked IGNORED.

Additionally fix a typo in backuptree's help text.

Change-Id: I90ddf4db826c891bf1daf6959f94feee17d35f78
Reviewed-on: http://gerrit.openafs.org/11857
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
2015-04-30 16:49:30 -04:00
Michael Meffie
df5f4925aa libafs: remove extraneous solaris headers from afs_util.c
Remove several solaris specific headers from afs_util.c which are no
longer needed.

Change-Id: Id3874c90448215dc506b7ab9b5e695c2aeef50f3
Reviewed-on: http://gerrit.openafs.org/11856
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2015-04-30 10:55:48 -04:00
Daria Brashear
ab9bb6363c osx: update afssettings for yosemite
handle deprecated functions

Change-Id: I437ec88b7909c38af247f44d58599da8810a72f2
Reviewed-on: http://gerrit.openafs.org/11836
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-04-23 00:55:42 -04:00
Jeffrey Hutzelman
fda2bc8747 Allocate pathname buffers dynamically
This change reworks numerous places which formerly used potentially
large on-stack buffers (of size AFSDIR_PATH_MAX) for constructing or
storing pathnames.  Instead, these buffers are now allocated from the
heap, either by using asprintf() to build a pathname in a correctly
sized buffer or, where necessary, using malloc() to allocate a buffer
of size AFSDIR_PATH_MAX.

A few occurrances of AFSDIR_PATH_MAX-sized buffers are not changed;
these are generally either globals or are contained within another
data structure that is already allocated on the heap.

[kaduk@mit.edu convert to cleanup-handler memory management where
appropriate]

Change-Id: Ib1986187a1c467e867d50280aaf1d8a86d9108c8
Reviewed-on: http://gerrit.openafs.org/9985
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-04-23 00:52:35 -04:00
Benjamin Kaduk
6f1979c83a vol: use ffs from opr instead of inline
volume.c defined its own ffs() macro if AFS_HAVE_FFS was not
defined.  Now that ffs() is in opr, just use it from there always.

Change-Id: Ia80a439924541be236b3221b9480143b511c885a
Reviewed-on: http://gerrit.openafs.org/11674
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2015-04-22 11:54:28 -04:00
Benjamin Kaduk
ec706b2153 Remove Linux 2.4 compat from RedHat packaging
You can't package what you can't build.

Change-Id: Ife3a46dfa1fee72b36d0f1fb21d82928aa8d83b6
Reviewed-on: http://gerrit.openafs.org/11833
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: Daria Brashear <shadow@your-file-system.com>
2015-04-15 10:51:04 -04:00
Benjamin Kaduk
d457769173 Remove linux24 conditionals from mcas/Makefile.osi
Linux 2.4 has been desupported by OpenAFS.

Change-Id: I7803d718ca9d2760a799f1ac2c438f8e6df8b9b9
Reviewed-on: http://gerrit.openafs.org/11806
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: Daria Brashear <shadow@your-file-system.com>
2015-04-15 10:49:30 -04:00
Benjamin Kaduk
b3ad01ec0c Remove stale MakefileProto.LINUX.in conditionals
Linux 2.4 and older are no longer supported; there's no need to
keep the noise in this file.

Change-Id: Ia1a968e0cdc1180e66bdedd0aa0638eadfd897fb
Reviewed-on: http://gerrit.openafs.org/11805
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: Daria Brashear <shadow@your-file-system.com>
2015-04-15 10:48:14 -04:00