Jeffrey Altman [Mon, 1 Oct 2012 16:03:49 +0000 (12:03 -0400)]
Windows: File Info Query Symlinks
For Symlinks, always set the Reparse Point attribute and
set the Directory attribute if the target is a directory.
Do not return the file attributes of the target.
Jeffrey Altman [Mon, 1 Oct 2012 15:04:23 +0000 (11:04 -0400)]
Windows: Dir Enum behavior for Symlinks / MPs
Comparisons of the behavior of cmd.exe, powershell.exe, and tcc.exe
with regards to directory enumeration show that when Symlink file
information is returned that the "reparse point" data should be
reported along with whether or not the target is a directory.
For mount points, the reparse point file information should always
be returned and the type should always be directory.
The target timestamps, file sizes, etc. should never be returned.
The process type check in afsredir.sys was performed during the
Process Creation callback which is processed in the context of the
parent process which might not be the same type (32-bit or 64-bit)
as the process being created.
In commit 19f1e0f7cf40c3da1d49c789358bd814f7e3b3eb strdup()
was replaced by xdr_alloc() and memcpy(). Unfortunately,
the patch was wrong and the pointer to which the result of
xdr_alloc() was assigned was overwritten with zero.
All callers to AFSDoExtentsMapRegion() hold the ExtentsResource
so there is no need to obtain it again within the function. Instead
add an ASSERT to confirm that the resource is held.
The RDR_ParseIoctlPath and RDR_ParseIoctlPathParent functions
are helper functions within RDRIoctl.cpp. Make them static
and remove them from the header.
The cm_req_t structure flags store information related to
the source of the request and whether the process is WOW64 or not.
This information is required for proper pioctl processing. Add
a cm_req_t structure to the RDR_ioctl_t structure and initialize
it in RDR_SetupIoctl() which is called from RDR_PioctlOpen().
on 64-bit Windows, only 32-bit processes have the WOW64 request
type flag set. Reverse the conditional to permit proper evaluation
of the 64-bit sysname list.
Andrew Deason [Tue, 25 Sep 2012 16:16:35 +0000 (11:16 -0500)]
RedHat: Avoid the DKMS escaping silliness
Depending on the version of DKMS, the current MAKE[0] variable in the
dkms.conf needs different numbers of backslashes. Commit 81a9a33e
tried to address this by changing the contents of dkms.conf depending
on whether or not we were on Fedora. However, the change occurred in
DKMS 2.2, so if someone running RHEL tries to use a newer DKMS, this
will fail.
So instead of trying to guess at the level of escaping we need, just
avoid needing to escape anything with backslashes. We can quote the
heredoc marker to avoid variable expansion inside the heredoc, we can
use a case statement instead of using backticks and local variables
and such, and we can use single quotes for the outer MAKE assignment.
With this, we should not need any backslashes when writing dkms.conf,
so we should work with any DKMS version.
Casting NULL shouldn't be necessary in most cases. Eliminate this
in favor of shorter lines and consistency. Function pointers, variadic
arguments should still be cast.
Marc Dionne [Thu, 27 Sep 2012 01:37:33 +0000 (21:37 -0400)]
viced: Remove unused gettimeofday calls
StartTime and EndTime are set with gettimeofday(), but are not
used for any calcualtions or statistics, and appear to never have
been used. There are platforms where gettimeofday is expensive,
so remove the variables and the calls.
Andrew Deason [Mon, 24 Sep 2012 18:03:34 +0000 (13:03 -0500)]
LINUX: Define printf/uprintf as variadic macros
Instead of defining the string 'printf' itself, make printf (and
uprintf) variadic macros. This avoids renaming printf to printk for
things like '__attribute__((format(printf,X,Y)))'.
Note that this is Linux-specific; compilers on other platforms may not
support variadic macros.
This avoids many warnings in the Linux kernel module build if we
include Linux headers after AFS headers.
Andrew Deason [Thu, 30 Aug 2012 22:10:36 +0000 (17:10 -0500)]
rx: More afspag-specific objects
For Linux, each object in the kernel module needs to be in only one
module for KBUILD_MODNAME. For AFS_RXERRQ_ENV, we pull in some
additional headers that require KBUILD_MODNAME in rx. So, just add a
few more afspag-specific rx objects.
Change-Id: I80b4a8648141856dffce6e26d5c034dffd8dd5cf
Reviewed-on: http://gerrit.openafs.org/8113 Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Tested-by: Andrew Deason <adeason@sinenomine.net>
Andrew Deason [Tue, 11 Sep 2012 23:46:42 +0000 (18:46 -0500)]
rx: Save errno in LWP rxi_Sendmsg
Much of this code examines errno or WSAGetLastError to determine what
to do. However, some other operations between the actual sendmsg call
and code that examines errno may modify errno. So, save the value of
errno to ensure errno reflects the actual error we got from sendmsg;
this also slightly simplifies some of the logic.
Andrew Deason [Thu, 2 Aug 2012 19:02:09 +0000 (15:02 -0400)]
doc: Add quotes to bos create in DAFS QSG section
In appendix C in the QSG, we give an example 'bos create'. The given
-cmd arguments should have quotes, or they will be interpreted as
individual arguments to 'bos create'.
Marc Dionne [Wed, 19 Sep 2012 00:29:06 +0000 (20:29 -0400)]
quiet build: Define NOQ version of LT_LDLIB_lwp
When the command is invoked within a case statement, we need the
"NOQ" version of RUN_LD. Add the LT_LDLIB_lwp_NOQ variant and use
it under src/sys where LT_LDLIB_lwp causes a build error.
perluafs is a shared library, therefore we need to use the PIC version
of the opr library (just like any of the other libraries that have two
flavors and get linked with perluafs).
Marc Dionne [Sat, 15 Sep 2012 17:53:06 +0000 (13:53 -0400)]
rxkad: silence unused variable warnings in v5gen.c
Sprinkle AFS_UNUSED attributes where the compiler complains
about unused variables.
Note that this file is assembled from code generated by the heimdal
source. A similar fix exists in the generator code upstream, so
when the file is re-generated in the future it should not be
necessary to re-apply this.
Simon Wilkinson [Sun, 16 Sep 2012 18:54:48 +0000 (19:54 +0100)]
tests: Convert opr tests to use libtool
Avoid the problems with libopr's dependencies by just converting
the tests to use the libtool version of the opr library. While we're
at it, make the tests pthreaded too.
Change-Id: I4e570b288ea57c758c848be1d545e5ee59771ab9
Reviewed-on: http://gerrit.openafs.org/8127 Reviewed-by: Jason Edgecombe <jason@rampaginggeek.com> Tested-by: Jason Edgecombe <jason@rampaginggeek.com> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Simon Wilkinson [Sun, 16 Sep 2012 14:39:25 +0000 (15:39 +0100)]
Split up libtool support into LWP and pthread
Currently, the type of library you build is determined by whether
the library is build in a pthread, or an lwp build directory. However,
this prevents building an LWP library in a directory that builds
pthreaded clients and servers.
As we want to continue to provide LWP libraries for backwards
compatibility, but move over to pthreaded binaries, this causes
some issues.
So, split up the libtool logic, so we have Makefile.libtool, which
you include if you want to build a pthreaded libtool library, and
Makefile.lwptool, for building a library which supports LWP and
pthreaded use. These only affect how .lo files are built - so the
.o files used for non-library objects are managed with the
Makefile.pthread and Makefile.lwp includes as before.
Simon Wilkinson [Sun, 16 Sep 2012 16:48:08 +0000 (17:48 +0100)]
tests: Fix volser Makefile
The volser Makefile had a bad path for liboafs_util, and was still
directly pulling in some objects from the fileserver build. Fix it
so that it uses proper libraries.
Change-Id: Ic36c6a0f93c299bd04d48fa4238c4da5cbc571d4
Reviewed-on: http://gerrit.openafs.org/8125 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jason Edgecombe <jason@rampaginggeek.com> Tested-by: Jason Edgecombe <jason@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Marc Dionne [Fri, 14 Sep 2012 23:23:55 +0000 (19:23 -0400)]
libafsauthent: fix parallel build
Same logic as ee18ccbe - we have to avoid building libafsauthent.la
and libafsauthent_pic.la at the same time. Add a dependency to
force make to build them in sequence.
Simon Wilkinson [Fri, 14 Sep 2012 10:42:56 +0000 (11:42 +0100)]
opr: Libtool archive should depend on symbol file
There should be a dependency between the libtool archive
liboafs_opr.la and the symbol map for the archive
(liboafs_opr.la.sym) so the archive is rebuilt if symbols are added
to, or removed from, the map file.
Simon Wilkinson [Wed, 12 Sep 2012 09:20:43 +0000 (10:20 +0100)]
libafs*: Don't re-export opr/util functions
On Solaris, a library can't re-export functions which come from one
of its dependencies - so libafsrpc can't easily republish the 5 opr
functions that are currently in the libafsrpc map file.
Including the bits of the opr library that define these functions
causes problems with then linking libafsrpc against libopr, which
we do in a number of places.
libafsauthent has exactly the same problem, with a few symbols that
it pulls in from util.
The affected symbols were all added relatively recently, and have
limited uses outside of the OpenAFS tree, so just remove them from
the export list so we are one step closer to building on Solaris
again.
Simon Wilkinson [Fri, 31 Aug 2012 10:13:06 +0000 (11:13 +0100)]
libafsauthent: Build with libtool
Construct the libafsauthent library with libtool. All libraries
contributing to libafsauthent provide a libauthent_<library>.la
convenience library, which we use libtool to combine into shared
and static versions of libafsauthent.
Simon Wilkinson [Wed, 12 Sep 2012 05:53:24 +0000 (06:53 +0100)]
opr: Add hcrypto to the library list
uuid needs hc_RAND_bytes, which means that liboafs_opr has a dependency
on hcrypto (and, until hcrypto is libtooled, on libroken as well). Make
this dependency explicit.
Simon Wilkinson [Wed, 12 Sep 2012 05:51:08 +0000 (06:51 +0100)]
ptserver: Fix parallel builds
It's not safe to have libtool building a blah.lo at the same time as
gcc is building blah.o. A Makefile must exclusively use either the .lo
or the .o form.
Fix ptserver so that ptint.xdr.lo is the only one referenced, and just
explicitly pull in the LWP object for the ptserver.
Simon Wilkinson [Thu, 30 Aug 2012 11:41:04 +0000 (12:41 +0100)]
kauth: Use libtool
Modify the kauth directory so that we use libtool to build its library.
Unlike most of our other directories, kauth has few pthreaded consumers
within the tree, so the libtool library itself is currently unused. The
libtool conversion is done as a stepping point for libafsauthent, which
does include kauth objects.
At the same time, we take the opportunity to modify kaserver so that it
uses libkauth, rather than referencing the library objects directly
Simon Wilkinson [Thu, 23 Aug 2012 21:18:49 +0000 (22:18 +0100)]
ptserver: Use libtool to build a pthreaded libprot
Use libtool to build a pthreaded version of libprot in src/ptserver.
Make the tptserver directory just build pthreaded versions of the
client and server, and link these against libprot
Simon Wilkinson [Thu, 23 Aug 2012 20:35:35 +0000 (21:35 +0100)]
ubik: Use libtool
Use libtool to build LWP and pthreaded versions of the ubik library.
Both versions are built in the src/ubik directory. src/tubik is modified
to only build pthreaded versions of the ubik test commands.
Replace use of libubik_pthread.a with the libtool generated library.
Marc Dionne [Tue, 11 Sep 2012 00:49:19 +0000 (20:49 -0400)]
libafsrpc: avoid concurrent libtool
libtool gets confused if it is running two instances in the same
directory, so make sure we build libafsrpc.la and libafsrpc_pic.la
one after the other.
Michael Meffie [Tue, 11 Sep 2012 12:59:13 +0000 (08:59 -0400)]
cmd: exit status zero from -help
Return of an exit status of zero when running commands with -help,
instead of returning an error. By general convention, and in
previous versions, tools do not not treat -help as an error.
The AFS::Command perl modules, use -help as an introspection
technique, and fail when commands run with the -help option returns
non-zero.
Simon Wilkinson [Wed, 22 Aug 2012 08:46:24 +0000 (09:46 +0100)]
libafsrpc: Assemble with libtool
Use libtool to assemble the libafsrpc shared and static libraries
from objects built with libtool in each of the directories that
contribute to the library (fsint, rx, rxkad, comerr, util, rxstat,
sys and lwp).
Each source directory controls which objects are built into the shared
library by making a libafsrpc_<dir> libtool convenience directory. These
convenience directories are then merged together to produce the
libafsrpc library.
Simon Wilkinson [Wed, 22 Aug 2012 11:45:43 +0000 (12:45 +0100)]
Don't explicitly build and link rx_pthread.o
A number of pthreaded directories explicitly build, and link, with
rx_pthread.o, in order to be able to send RX 'dpf' debugging messages
to the server log, rather than to stderr.
However, this direct linking causes build failures on some platforms,
because we end up linking in a version of rx_pthread.o, twice and both
versions contain identical linker symbols.
As this functionality is only used for debugging, just get rid of the
additional object.
Simon Wilkinson [Wed, 22 Aug 2012 08:39:59 +0000 (09:39 +0100)]
fsint: Move to using libtool
Move the fsint directory over to building a libtool library
(liboafs_fsint). Because libtool requires that libraries have no
unresolved dependencies, we cannot include the server side stubs in
the libtool library.
Simon Wilkinson [Thu, 24 May 2012 21:08:45 +0000 (22:08 +0100)]
lwp: Build a pthreaded compat library with libtool
The majority of the LWP directory isn't used by pthreaded applications.
However, there are three files - fasttime.c, lock.c and waitkey.c which
are used within pthreaded code.
Eventually, these should live somewhere other than the LWP directory.
For now, just build a small pthreaded library to hold them, so we
can finish up with the libtool work before considering how to move
this code elsewhere.
Simon Wilkinson [Sun, 9 Sep 2012 09:19:53 +0000 (10:19 +0100)]
rxkad: Use rxi_Alloc not osi_Alloc
rx exposes the rxi_Alloc function to be used for memory allocation
in security classes, not osi_Alloc which is private. Using rxi_Alloc
means that allocations are counted in the general rx statistics.
Modify rxkad so that it uses rxi_Alloc. This also restores symmetry
in the allocator - the memory that's allocated by rxkad_server is
already freed using rxi_Free in rxkad_DestroyConnection
Marc Dionne [Sat, 8 Sep 2012 19:43:17 +0000 (15:43 -0400)]
comerr, cmd, opr: fix library install targets
Fix a couple of issues in the install targets following the libtool
changes:
- don't install liboafs_comerr or liboafs_opr, they're not ready to
be exposed to the outside world
- fix the libcmd.a install target to use INSTALL_DATA and the correct
library name
Simon Wilkinson [Thu, 24 May 2012 10:24:47 +0000 (11:24 +0100)]
sys: Use libtool for pthreaded library
Create a pthreaded version of libsys.a, called liboafs_sys.a
On AIX, the sys library is special because it includes references to
two syscall stubs - lpioctl and lsetpag. This means that we can't link
the library with -no-undefined, as the references to these stubs are
only resolved at run time.
Simon Wilkinson [Thu, 24 May 2012 10:08:48 +0000 (11:08 +0100)]
rx: Build libtool library
Build a pthreaded, libtool, version of librx.a called liboafs_rx.la.
librx.a remains for LWP applications to use. With this change, all RX
objects are built in both the LWP and pthread cases, so some #ifdef
guards are required to protect code that isn't relevant in a given
build.
Currently, all of our pthreaded objects use libafsrpc to get RX
functionality, so this change is fairly minimal outside of the RX
directory.
Simon Wilkinson [Thu, 24 May 2012 09:26:21 +0000 (10:26 +0100)]
usd: Convert to using libtool
Turn the libusd library into a libtool object (it has no pthread/LWP
differences, and so can just become a pthreaded library), and include
it as such in butc and the volser. liboafs_usd.la is the libtool
object, libusd.a is preserved as a static object for backwards
compatibility.
Simon Wilkinson [Thu, 24 May 2012 08:14:18 +0000 (09:14 +0100)]
util: Convert to using libtool
Create a pthreaded version of libafsutil, named liboafs_util.la,
and use this library in all of the pthreaded binaries that we build,
replacing both inclusion of libafsutil.a, and direct compliation of
pthreaded versions of the util source files.
libafsutil.a is provided for legacy LWP applications, and the
convenience library libafsutil_pic.a remains until we address the way
in which the user space cache manager is built and linked.
Simon Wilkinson [Wed, 23 May 2012 20:43:57 +0000 (21:43 +0100)]
cmd: Convert to using libtool
Convert the libcmd and libcmd_pic libaries to being built using
libtool. Historically, these have been built as LWP code, but they
have no LWP dependencies, and no LWP-specific code within them. So,
make cmd a pthread-only library.
In addition to the libtool library liboafs_cmd.la, we build the
legacy libcmd.a and libcmd_pic.a as convenience libraries. libcmd64.a
(a 64bit variant, used solely by kdump), remains built through
"normal" means.
Update pthreaded users of libcmd to use the new liboafs_cmd.la. For
now, non-pthreaded users are left alone.
Simon Wilkinson [Fri, 7 Sep 2012 12:51:29 +0000 (13:51 +0100)]
comerr: Fix a couple of libtool problems
The comerr libtool patch was submitted before buildbot had a chance
to verify it. Fix a couple of problems that buildbot identified:
*) On AIX liboafs_comerr needs to link against roken
*) On OpenSuSe the LWP CC command has a space in it, so needs to
be quoted before being passed in to lwptool
Simon Wilkinson [Tue, 22 May 2012 07:37:08 +0000 (08:37 +0100)]
comerr: Convert to using libtool
Convert the libafs_comerr library so that it uses libtool.
comerr uses a pthread lock to protect the error tables, so it needs
to be built as both an LWP, and a pthread library (previously, we've
just built it as LWP, which is probably broken on some platforms, as
it won't define -D_REENTRANT)
libafscom_err.a remains as the LWP variant, and all pthreaded code is
modified to use the libtool liboafs_comerr.la library.
Simon Wilkinson [Fri, 7 Sep 2012 10:43:21 +0000 (11:43 +0100)]
lwp: Fix stupid mistake in lock.h
My earlier change to lock.h got the sense of the opr_Verify test wrong,
so we would assert() whenever the lock call succeeded. Fix this, so
things work again.
Andrew Deason [Mon, 7 May 2012 16:15:24 +0000 (11:15 -0500)]
tests depends on viced
Some of the tests code (specifically, that in tests/volser) depends on
objects in src/viced being build (specifically, vldbint stuff). So,
make 'tests' depend on 'viced', so they are built before we get there.
Andrew Deason [Fri, 18 May 2012 21:55:09 +0000 (17:55 -0400)]
afs: Do not avoid DNLC if fakestat is set
Currently in afs_lookup we avoid putting an entry in the DNLC if
'force_eval' is unset, in order to avoid populating the DNLC with
mountpoint symlinks (we want the target of the mountpoint to be in
there instead, the root dir). However, if -fakestat or -fakestat-all
are enabled, 'force_eval' is always false, since we only set it to
true under certain circumstances when evaluating mountpoints.
To fix this, populate the dnlc for non-mountpoints, even if force_eval
is unset.