Simon Wilkinson [Tue, 6 Apr 2010 23:29:44 +0000 (00:29 +0100)]
Linux: kmap() not page_address()
Using page_address() will return NULL if the page is in highmem. To
avoid this, we must kmap() the page we're getting the address of,
and kunmap() when we are done. If the page isn't in high memory, then
kmap() is equivalent to page_address().
aklog was previously writing the magic AFS ID string into previously
alloated memory with sprintf, but the variable in question was only
as long as the username, so this code could overwrite memory and lead
to heap corruption. Free previously allocated memory and use
afs_asprintf to format the AFS ID string instead.
Add a caution to the fileserver man page explaining that traditional
and demand-attach require different configurations, and also mention
that there are two different server implementations. Add an example
of a bos create command for creating a demand-attach File Server to
the fileserver man page.
Add a caution to the bos create man page that a traditional fs node
won't work with demand-attach and vice versa. Document the necessary
arguments for the dafs type. Clarify in EXAMPLES which bos create
commands are traditional and which are demand-attach. Add an example
of changing from a traditional to a demand-attach configuration.
Change kaserver to ptserver in the example of a simple process.
* Upstream no longer includes files covered by the Apple Public Source
License, so we no longer have to repackage the upstream source to
remove those files. Drop Debian patches to the build system that were
compensating for the removal of those files.
* Switch to generating upstream tarballs from the upstream Git tag
rather than from tarball releases. There's no reason to include all
the generated files when we're going to regenerate them anyway, and
this saves effort combining the doc and src tarballs.
Russ Allbery [Fri, 26 Mar 2010 19:25:01 +0000 (12:25 -0700)]
Don't add CellServDB records if AFSDB is in use
* If the user configures openafs-client to use AFSDB records for VLDB
server location, don't prompt the user for VLDB servers for the local
cell even if they're not present in CellServDB and don't try to add an
entry for the local cell to CellServDB. (Closes: #575299)
Windows: cm_UpdateVolumeLocation !append exts to num vol names
cm_UpdateVolumeLocation will append ".readonly" to a volume
name if the base name cannot be located. However, this should
not be done if the base name is numeric.
Rx: Remove conn_call_lock contention between rx_NewCall and rx_EndCall
Add a new call state, RX_STATE_RESET, which permits us to
remove the conn_call_lock contention between rx_NewCall
and rx_EndCall. It is no longer necessary for rx_NewCall
to hold conn_call_lock across rxi_ResetCall which can block.
rx_EndCall is therefore always free to complete without
unnecessary delays caused by rx_NewCall.
The usage of RX_CALL_TQ_WAIT flag was not consistent within both
rx.c and rx_rdwr.c. When a thread is waiting on the transmit
queue it must not only set the RX_CALL_TQ_WAIT flag but also
increment the call->tqWaiters count. Upon waking up, it must
decrement call->tqWaiters and only clear RX_CALL_TQ_WAIT if
the tqWaiters count reaches zero.
Andrew Deason [Thu, 1 Apr 2010 21:42:25 +0000 (16:42 -0500)]
tubik: Correct use of flags_cond and version_cond
Waiters of flags_cond and version_cond were not doing so correctly;
the correct way is to acquire a lock prior to their respective checks,
and atomically drop/acquire that lock with pthread_cond_wait.
Otherwise, we could miss a wakeup if a flag changed between our check
and when we wait.
To make this possible, make versionLock a normal pthread mutex in
AFS_PTHREAD_ENV, so it is a lock we can pass to pthread_cond_wait.
Make the waiters pass versionLock to pthread_cond_wait, and eliminate
flags_mutex and version_mutex.
Andrew Deason [Thu, 1 Apr 2010 20:33:24 +0000 (15:33 -0500)]
Kill afs_inet_ntoa
Replace all calls to afs_inet_ntoa with the threadsafe
afs_inet_ntoa_r. afs_inet_ntoa was being used in a few places that may
be threaded (ubik), and in general should be avoided in case the
relevant code becomes threaded. Remove the definition of afs_inet_ntoa
to prevent anyone from using it.
Andrew Deason [Thu, 1 Apr 2010 18:18:41 +0000 (13:18 -0500)]
fssync-debug: fix strict-aliasing problems
We cannot type-pun pointers like that. Instead, declare a new struct
on the stack, and copy the memory into it. Remove the CFLAGS_NOSTRICT
suppression on fssync-debug.o.
Ben Kaduk [Thu, 1 Apr 2010 02:28:10 +0000 (22:28 -0400)]
Set a storeOps storeproc for the memcache case
Finish fixing the bug from 34ffc9cd that 57d8e454 only partially
fixed -- set a storeOps.storeproc element in rxfs_storeMemOps
as well as in rxfs_storeOps. This eliminates a NULL/uninitialized
memory dereference.
Ben Kaduk [Wed, 31 Mar 2010 15:27:38 +0000 (11:27 -0400)]
Fix build for FBSD80
The change to a dynamically-allocated group list came before
the change to allow the maximum size of that group list to
be set as a tuneable at boot. The 8.0 release happened to
come between them, so we must treat both cases.
(Note that AFS_FBSD81_ENV is not yet defined anywhere; that
will come later.)
Ben Kaduk [Wed, 31 Mar 2010 00:34:02 +0000 (20:34 -0400)]
Make GCPAGs_perproc_func cleaner for FBSD case
Partially rewrite 2cf1f10a to reduce code clutter.
Instead of accessing pproc->p_ucred directly in afs_GCPAGs_perproc_func(),
push this access into a FBSD-specific afs_proc2cred() function.
This is not quite right, since we do not lock the proc mutex, but
in the same way as the old version and with more reasonable preprocessor
conditionals.
This also eliminates a probably-needless call to osi_Panic.
Updated RedHat RPM spec file to include unreferenced files
Added the libkopenafs libraries and headers to the authlib package.
Added the afs_compile_et binary to the devel package
Removed the reference to .../man5/afszcm.cat.* because it is already
caught by the earlier reference to .../man5/afs* glob. This caused a
warning during the package build process.
Russ Allbery [Tue, 30 Mar 2010 05:17:31 +0000 (22:17 -0700)]
Update VCS instructions for Git
Rename README.CVS to README.GIT and update the references from CVS
to GIT. Refer readers to the wiki for the detailed instructions and
information about Gerrit.
Rod Widdowson [Wed, 24 Mar 2010 16:59:15 +0000 (16:59 +0000)]
Render the IP address for the "Ubik: Lost contact with sync-site" log
message in the same way that all other IP addresses are (via
afs_inet_ntoa, rather than stripping the buytes out in a manner which
assumes a specific endianism).
Done more as a way to test my understanding of the GIT/GERRIT
technology with a small non-important checkin.
Change-Id: I177e1288e8e23087aeebb7abe4ed63a7c2b88ccb
Reviewed-on: http://gerrit.openafs.org/1649 Tested-by: Rod Widdowson <rdw@steadingsoftware.com> Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com> Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Ben Kaduk [Tue, 23 Mar 2010 02:35:51 +0000 (22:35 -0400)]
Catch up to dynamically-sized cr_groups in FBSD80
In FreeBSD 8.0 and later, (struct ucred)->cr_groups is a pointer
to a dynamically-allocated array, and NGROUPS is now 1024 by default
(tuneable at boot).
Don't put a gid_t[NGROUPS] on the stack for the FBSD80_ENV case.
Also avoid keeping a function-local ucred structure (in
afs_osi_proc2cred()), by bypassing that function entirely
(though this accesses the process credentials directly, which may
require locking; thread credentials accesses can be safely done
lock-free). Add an osi_Panic() to ensure that it stays that way.
Don't pretend that we have a useful afs_osi_cred to export.
Don't blindly overwrite NGROUPS past cr_groups.
Jeffrey Altman [Sat, 27 Mar 2010 20:13:27 +0000 (16:13 -0400)]
Windows: buffers whose offsets are beyond EOF should be zero filled and locally allocated
When a buffer is being allocated for an offset that exceeds the
file length as known to the file server, that buffer should be zero
filled and it does not require server validation.
Previously all buffers were populated with a FetchData call.
This is wasteful of time and server resources when there is a
valid callback registration because the serverLength is known
to be valid.
LINUX: you dont need to memset() after allocating credentials
If you wanted to create a blank credential, you wouldn't want to make
it uid = 0. Anyone allocating a credential SHOULD properly fill in all
fields making this blanking operation moot. Regardless, this memset()
is before the allocation failure test and would/could panic.
Change-Id: Ia182a874a5e1bf28a2cd94898f67d81e5588d58c
Reviewed-on: http://gerrit.openafs.org/1080 Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Jeffrey Altman [Thu, 25 Mar 2010 05:23:23 +0000 (01:23 -0400)]
Windows: afslogon.dll vs windows 7
In Windows 7 the GINA is no longer used. As a result, when a
non-Heimdal realm is used for logon, the LogonDomain field
is no longer populated during the NPLogonNotify call. Instead
we must obtain the Kerberos realm from the UPN specified in
the Username field.
Jeffrey Altman [Thu, 25 Mar 2010 04:40:29 +0000 (00:40 -0400)]
Windows: aklog must reset viceId to 0 before pr_CreateUser call
If the viceId is not reset to 0, the ptserver believes the
client is attempting to request the anonymous id value
and fails the registration request with permission denied.
Booker Bense [Fri, 5 Mar 2010 15:11:41 +0000 (10:11 -0500)]
Updating UserGuide with Kerberos v5 authentication
This patchset contains updates to the OpenAFS UserGuide that
explains how to authentication OpenAFS using kinit/aklog
and uses language describing Kerberos outside the context
of the kaserver. References to applications such as telnet
have been replaced with more modern equivalents such as ssh.
Asanka Herath [Fri, 19 Mar 2010 01:13:35 +0000 (21:13 -0400)]
Windows: Monitor requests and gather diagnostics before a timeout
This patch monitors SMB requests that are being serviced and
automatically enables logging if a request takes longer than one
minute to complete. If the requst hasn't completed by the two minute
mark, the code generates a minidump. Once a minimump is generated, no
more minidumps will be produced for another 5 minutes.
SMB monitoring can be enabled/disabled using the new registry
parameter 'SMBRequestMonitor.'
Asanka Herath [Sat, 20 Mar 2010 20:46:05 +0000 (16:46 -0400)]
Windows: Make default mode bits configurable
Mode bits aren't directly exposed by the Win32 API. We were leaving
them to default to 0777 when creating new files and directories.
This patch introduces two configuration parameters;
'UnixModeFileDefault' and 'UnixModeDirDefault' which are DWORD
registry entries that are used to set the initial mode bits.
If the values are set to 0, then the behavior is identical to what we
had before.
Claudio Bisegni [Mon, 22 Mar 2010 22:35:22 +0000 (23:35 +0100)]
Develop Kerberos renew system for ticket
- In Preference pane has been added a tab called "Option" where are
showned the option for kerberos renew
- In AfsBackgrounder has been implemented the NSTimer that will call
the krb5 renew action according to user preference value
Andrew Deason [Tue, 9 Mar 2010 20:48:36 +0000 (14:48 -0600)]
vos: correct syncvldb -verbose server byte order
'vos syncvldb -verbose' outputs the before/after VLDB entries for
altered entries, but the 'after' output shows server addresses in NBO.
EnumerateEntry expects server IPs to be in NBO, so correct one location
where they were passed in HBO.
Andrew Deason [Wed, 10 Mar 2010 20:15:58 +0000 (14:15 -0600)]
vos: Avoid LWP stack overflow error on SIGINT
vsproc's method of longjmp'ing out of a signal handler can thoroughly
confuse LWP. At the very least, the information on our stack becomes
incorrect, since we're no longer using the stack supplied by LWP. At the
very least, we seem to (almost) always fail the sanity check checking
for stack overflow. To prevent the test from happening, NULL the stack
pointer before the longjmp so we can attempt recovery.
Andrew Deason [Wed, 10 Mar 2010 17:58:04 +0000 (11:58 -0600)]
vos: Use IOMGR_SoftSig for signals
When vsprocs tries to longjmp from the signal handler, use IOMGR_SoftSig
first, so sleeping processes are woken back up. Without this, IOMGR can
bail out since it finds no processes READY when we attempt to do
anything with RX.
Andrew Deason [Wed, 10 Mar 2010 00:07:18 +0000 (18:07 -0600)]
vos: Mark longjmp-used variables as 'volatile'
vsprocs tries to do error recovery by calling longjmp from a signal
handler. Although this is quite error-prone since we call a ton of
non-async-signal-safe functions, make it a bit more likely to work by
marking variables that are used after the longjmp as volatile. This
reduces how often (depending on the platform) these values will be
completely worthless after a longjmp since they were cached in a
register or similar.
Russ Allbery [Mon, 22 Mar 2010 22:00:39 +0000 (15:00 -0700)]
Fix strict aliasing problems or add -fno-strict-aliasing
Create a new CFLAGS_NOSTRICT Autoconf substitution variable which
is set to -fno-strict-aliasing if we're using gcc to compile. Add
@CFLAGS_NOSTRICT@ to the C compiler flags for source files that have
significant strict-aliasing issues.
Fix minor strict-aliasing issues elsewhere in the tree by using memcpy
to copy the data into a properly typed variable.
Andrew Deason [Mon, 15 Mar 2010 17:41:11 +0000 (12:41 -0500)]
Use AC_USE_SYSTEM_EXTENSIONS
Instead of defining various symbols like _XOPEN_SOURCE, _BSD_SOURCE, and
the like, just use autoconf's AC_USE_SYSTEM_EXTENSIONS to define all of
the appropriate symbols for us. Deal with some fallout by removing some
of the existing defines.
Simon Wilkinson [Thu, 18 Feb 2010 00:04:22 +0000 (00:04 +0000)]
XDR: Stop the madness
We currently attempt to align our XDR implementation with what may
be provided by the host system. This leads to a huge amount of parameter
fudging, and general pain and misfortune. However, the only place that
we still actually use the system XDR is for UKERNEL builds.
Change this so that we use our XDR everywhere. Fix all of our type and
function definitions so that they're standard. Remove the warning
inhibitions.
Russ Allbery [Mon, 22 Mar 2010 19:56:09 +0000 (12:56 -0700)]
Use sigset_t and sigfillset instead of memset
Rather than using an arbitrary array memset to ones as our signal
mask, use the POSIX sigfillset function and eliminate the static
variable. Fixes strict aliasing errors with --enable-checking and
gcc 4.4.3 on Linux x86.
Change-Id: Ic3e0499d03657d94f60808ed12e090dc62cce6fc
Reviewed-on: http://gerrit.openafs.org/1616 Tested-by: Russ Allbery <rra@stanford.edu> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Tested-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Russ Allbery [Mon, 22 Mar 2010 19:42:48 +0000 (12:42 -0700)]
Move non-executable stack assembly code to end of file
The non-executable stack annotation used for Linux works by adding
an additional section to the generated object. The annotation added
in 9bfd03d723a9cf17673f40513a7adde1d503bcbc was added to the beginning
of each assembly file. This caused build failures on Linux s390
because the remainder of the assembly code was then put in that
section, which was discarded during linking.
Add the annotation to the end of each assembly file instead, following
the instructions at: