Commit Graph

262 Commits

Author SHA1 Message Date
Marcio Barbosa
e316a38ba9 DARWIN: Add --with-macos-* packaging options
To create the OpenAFS client for macOS, the current process involves
building the code, signing the binaries, creating the package, and
notarizing it. Each step is typically performed separately and requires
distinct parameters and credentials, making this process cumbersome and
difficult to follow.

To simplify this process, introduce the following '--with' options:

--with-macos-app-key
--with-macos-inst-key
--with-macos-keychain-profile

These options allow users to specify the credentials needed for signing
and notarizing the package upfront.

With these enhancements, users will be able to perform the entire
workflow - building, signing, creating, and notarizing the package -
with a single 'make packages' command, significantly simplifying this
process.

Change-Id: Ibf114f4f5bbe9bc72f37adc487c046e5243f5a97
Reviewed-on: https://gerrit.openafs.org/15977
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
2024-12-20 10:51:59 -05:00
Marcio Barbosa
120871f03f DARWIN: Add 'privhelper' tool for PrefPane
The prefpane for macOS runs as the logged-in user, but needs root access
for some operations: starting/stopping the client, editing various
configuration files like CellServDB, etc. We currently use functions
like AuthorizationExecuteWithPrivileges() to run commands with root
privileges directly, but this approach no longer works as of macOS 10.8
(Mountain Lion); the relevant functions have been removed.

Instead, a new approach exists as of macOS 10.6 (Snow Leopard). The
prefpane application itself cannot gain root privileges, but we can
provide another daemon process that runs as root, and the PrefPane sends
requests to that process to perform the privileged operations we need.

In this commit, create a separate helper program called PrivilegedHelper
(privhelper for short) that serves this purpose. Define the
executePrivTask() method in TaskUtil to handle communicating with
privhelper over XPC.

This commit does not define any of the tasks that privhelper will
actually perform; this just implements privhelper itself. Later commits
will add and use various privileged tasks in privhelper.

In order for privhelper to be able to run as root, both privhelper and
the prefpane itself must be code signed and the relevant apple team id
must be specified in their Info.plist when they are built, as well as
inside privhelper.c. Currently, we have
no way of specifying code signatures info during the build, since all code
signing is done when generating packages (via pkgbuild.sh) after
binaries are built. For now, just put a commented-out section in
src/platform/DARWIN/AFSPreference/Info.plist and
src/platform/DARWIN/PrivilegedHelper/privhelper-info.plist and a
placeholder in src/platform/DARWIN/PrivilegedHelper/privhelper.c to show
how to add this information. The package builder must add their own team
id to these before privhelper can work properly.

The privhelper tool checks that the calling user has authorization to
run commands as root (via AuthorizationCopyRights()), and that the
calling process is either our AFSBackgrounder menu bar or the prefpane.
We use xpc_connection_set_peer_code_signing_requirement() for this where
available, but fallback to using SecCodeCheckValidity() with
SecCodeCreateWithXPCMessage() or
xpc_dictionary_get_audit_token()/SecCodeCopyGuestWithAttributes() if
needed.

Change-Id: I724b6d486ee5397c89c79e589ddcb2a5987a895b
Reviewed-on: https://gerrit.openafs.org/15956
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
2024-12-06 11:12:56 -05:00
Cheyenne Wills
80c23d958c tests: Make src/tests buildable
Several files in src/tests fail to build due to compiler warnings when
building with --enable-checking.  There are also unresolved references
during the link steps.

The warnings are for

    implicit-fallthrough
    unused-result
    unused-but-set-variable
    invalid-source-encoding

In addition the "all" make target references a variable that is set
later in the file, so the resulting list of targets is incorrect and are
not built.

Move libopr.a, ${LIB_hcrypto} and ${LIB_roken} from INT_LIBS into
COMMON_LIBS to resolve link failures in:
    test-setgroups
    test-setpag
    dup2-and-unlog
    create-stat
    rm-rf
    write-closed2
    afscp

Update code that prints usage to use warnx instead of relying on
__progname.

Check for errors for various syscalls, to avoid "unused-result"
warnings.

Remove 'read_buf1' in read-write.c to avoid an "unused-but-set-variable"
warning.

Add a missing 'break' to a switch statement in utime-file.c to avoid an
"implicit-fallthrough" warning. Add an AFS_FALLTHROUGH to fsx.c to avoid
the same warning; it seems like this may be a mistake and maybe should
be a "break", but match the existing fsx.c behavior at least for now,
since the intended behavior isn't completely clear.

Relocate the Makefile "all" target so it follows the macro definition
that it references.

Rename the top level Makefile target from tests to srctests for the
recipe that invokes make to build src/tests. Add the necessary
dependencies to the srctests target. Add srctests to the
finale_notest/finale_nolibafs_notest targets

Make sure the 'OpenAFS' dir exists when generating OpenAFS/Dirpath.pm
and OpenAFS/Dirpath.sh. For objdir builds, it may not exist when we
try to generate these files.

Note The code within the src/tests directory may be out of date. This
commit only ensures that the src/tests can build cleanly.  Further work
will be needed to validate the tests and ensure that they are
still working as intended.

Change-Id: Ic6d685c0dde5df25da175fe4516ce28a26443533
Reviewed-on: https://gerrit.openafs.org/15342
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
2024-10-03 15:44:31 -04:00
Mark Vitale
159bd949a4 build: Repair 'make pristine' target
Commit c66971ce42 'man-pages: Generate man
pages with Pod::Man' inadvertently broke the top-level Makefile.in
'pristine:' rule.

This leads to the following error with 'make pristine':
  ...
  doc/man-pages/man5 \
  doc/man-pages/man8 \
  for i in doc/man-pages/pod*/*.pod.in; do \
      /bin/rm -f ${i%.in}; \
  done
  sh: syntax error at line 15: `do' unexpected
  *** Error code 3
  make: Fatal error: Command failed for target `pristine'

Remove the stray line continuation so the pod file deletion script will
work properly.

Additionally, the doc/man-pages/man* file objects are directories;
therefore the existing pristine rule 'rm -f' command will fail to remove
them:
  ...
  doc/xml/mobi-fixup.xsl \
  doc/man-pages/man1 \
  doc/man-pages/man3 \
  doc/man-pages/man5 \
  doc/man-pages/man8
  rm: doc/man-pages/man1 is a directory
  rm: doc/man-pages/man3 is a directory
  rm: doc/man-pages/man5 is a directory
  rm: doc/man-pages/man8 is a directory
  *** Error code 2
  make: Fatal error: Command failed for target `pristine'

Reinstate the former 'rm -rf' command so the man-pages/man* directories
will also be properly erased.

Change-Id: I11658de0c02679d6c4b57917949cf2a70c9c019f
Reviewed-on: https://gerrit.openafs.org/15782
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-07-13 03:59:44 -04:00
Michael Meffie
168badb037 build: Remove doc directory checks
Originally, OpenAFS documentation was maintained in a separate tree, so
the doc directory may not be present when doing a build. However, the
docs have been maintained in-tree for many decades, and even though we
still distribute the doc tree in a separate tar archive, package
builders are accustomed to unpacking the docs archive in order to
package the man pages.

Clean up and simplify the top level makefile by removing the checks for
the doc directory. Unconditionally generate the Makefiles from
Makefile.in files in the doc tree.

Starting with this change, unpacking the doc tarball will be required
(no longer just optional) when building from source distribution
tarballs.

Change-Id: Idfadb33d365777a561dc64e7d336a49eb74b8b48
Reviewed-on: https://gerrit.openafs.org/15772
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-07-09 11:21:54 -04:00
Andrew Deason
5df08384dc tsm41: Fix various errors in aix_aklog.c
The clang-based xlc 17.1 compiler on AIX throws various errors when
compiling aix_aklog.c. Fix them:

- We make a couple of pr_* calls, but don't include ptuser.h. Include
  it, to get the prototypes for those functions. (Also make the tsm41
  dir depend on ptserver, to ensure the header is available.)

- Include ctype.h for the functions islower(), et al.

- Move aklog_authenticate() to after auth_to_cell(), so auth_to_cell()
  is defined before it is referenced.

Also declare most of our functions as 'static' while we're here.

Change-Id: I0d3ce2c1e4bab3d20969f869128fc603c71bc019
Reviewed-on: https://gerrit.openafs.org/15448
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-07-01 14:51:10 -04:00
Andrew Deason
1fe1dac4c5 rxkad: Cleanup and build src/rxkad/test
We currently do not build 'fc_test' or any of the programs in
src/rxkad/test, and they've bitrotted as a result. Clean them up so
they can build again, and make them all built by default.

Some of these programs depend on higher-level libraries (like
libafsauthent) that depend on rxkad, so we cannot build the test
programs during the top-level 'make rxkad' target. So instead, create
a new top-level target called 'rxkad_test' that just builds the test
programs. Move 'fc_test' into the test subdir to make it easier to
build with the other test programs.

Change-Id: Ic5570efd9076e3e4feec18002d67ce8d58f321d1
Reviewed-on: https://gerrit.openafs.org/14750
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2024-06-27 22:02:23 -04:00
Michael Meffie
bd263e367d RedHat: Add RPM_BUILD_MODULES and RPM_BUILD_USERSPACE
Add makefile variables to specify if we are to build the userspace
and/or kernel module (kmod) packages.  Continue to build both by
default.

Change-Id: Idc20d5140fcb60cbe84a500b2a7580866008e3e0
Reviewed-on: https://gerrit.openafs.org/15407
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-26 12:59:48 -04:00
Michael Meffie
86d9e3368d RedHat: Add RPM_RELNOTES, RPM_CHANGELOG, and RPM_CELLSERVDB
Currently, when building the source RPM with make, the release notes and
change log are empty, and the CellServDB file is downloaded from
grand.central.org.

Instead, by default, package the NEWS file for the release notes, the
ChangeLog generated by the 'make-release' script, and a CellServDB file
in the source tree.

Add the RPM_RELNOTES and RPM_CHANGELOG makefile variables so we can
override the defaults if builders want to provide their own release
notes and change log files.  Builders can specify empty values on the
make command line to fallback to empty files for the RELNOTES and
ChangeLog (which was the old behavior before this change).

Add the RPM_CELLSERVDB makefile variable to specify the local CellServDB
file to be packaged. By default, package src/afsd/CellServDB from the
working tree (which matches the one specified in the openafs.spec.in
used to build the source rpm).  Builders can specify an empty
RPM_CELLSERVDB on the make command line to have makesrpm.pl download the
CellServDB file from grand.central.org (which was the old behavior
before this change).

Change-Id: Idf1afd1683d87d882d2c7e49058cbf18839e5c9e
Reviewed-on: https://gerrit.openafs.org/15406
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-26 12:59:25 -04:00
Michael Meffie
d3bbd0bda6 Clean up packages directory with make clean
The 'packages' directory is created by the top makefile when building
source tarballs and RPM package files.  Remove this directory when
running 'make clean', just like we already do for the output of the
legacy 'make dest' target.

Change-Id: Icc912e8025d15dd2f3f52c9ffaa9d29f8c19268b
Reviewed-on: https://gerrit.openafs.org/15475
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-26 12:58:55 -04:00
Andrew Deason
cee94469b8 Remove TOP_JLIBDIR
In Makefile.config.in, the Makefile variable TOP_JLIBDIR is set to the
autoconf variable TOP_JLIBDIR. Except, we don't export anything called
TOP_JLIBDIR from autoconf, and never have. So, TOP_JLIBDIR gets set to
the literal string @TOP_JLIBDIR@, which is useless.

To get rid of this cruft, just remove references to this variable in
the top-level Makefile.in and Makefile.config.in, where it was clearly
not working.

[mmeffie: Updated commit message after rebase.]

Change-Id: Ic7e64d3743c99065dea8371bdc1007835c94edbd
Reviewed-on: https://gerrit.openafs.org/13810
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-26 12:57:38 -04:00
Cheyenne Wills
2856a350d0 afsweb: remove unsupported afsweb component
The afsweb component is marked as obsolete.  The last substantial change
other than global changes was in 2002 to add build support for netscape
(afsweb-add-netscape-config-script-20020213 0e04c507b).  The
documentation and build configuration implies support for Apache 1.3.6
which was released in 1999; and the Apache 1.3 series as a whole was EOL
in 2010.

By default the afsweb component isn't built.

Clean out the source and references for the afsweb component
(src/afsweb).

Change-Id: Ibb3f91260d4e8d703619fafbad70cd3f7e4da7bc
Reviewed-on: https://gerrit.openafs.org/14849
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
2024-06-13 15:29:05 -04:00
Cheyenne Wills
cbfdf1ed97 JAVA: remove unsupported JAVA component
The Java (libjafs) component has been marked as obsolete.  Other than
a minor update in 2007 (java-admin-interface-updates-20071214 f72145f79)
there have been no substantial changes since 2003
(java-jafs-update-20030619 af1a0ea03). Changes since then have been
mostly related to source cleanups and a commit in 2012 (Make libjafs
buildable again 967d7201ee).

By default the Java component isn't built and an attempt to build fails
with an error in the src/JAVA/libjafs/Makefile:
make[1]: Entering directory '.../src/JAVA/libjafs'
Makefile:34: *** Recursive variable 'CC' references itself (eventually).
             Stop.

Clean out the source and references for the obsolete JAVA component
(src/JAVA).

Change-Id: Idc241e08f62a1b9384a5ce4d0f2fdb13e2f96904
Reviewed-on: https://gerrit.openafs.org/14839
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2024-06-13 12:18:15 -04:00
Sahil Siddiq
3961e416f6 rx: Cleanup and build simple.example
Our simple.example is not built by default, and currenly does not build
for a couple of reasons:

There are undefined references to symbols in "lib/libafsrpc.a". For
example, there is an undefined reference to "hc_RAND_bytes" in
"rx_InitHost" in libafsrpc.a (rx.o). Modify the rules in
simple.example's Makefile.in to link the object files with hcrypto and
roken to fix this.

Running rxgen fails on objdir builds, because we weren't specifying a
srcdir path for sample.xg. Specify ${srcdir}/sample.xg instead.

Also change simple.example to be built by default to improve its
maintainability. Add it to the "rx_test" top-level make target, since it
depends on libafsrpc and libafsauthent.

[adeason@sinenomine.net: Use the existing rx_test target, slight commit
message edits.]

Change-Id: I9196ab170c594e9b5567e8f299625e4ff07f00eb
Reviewed-on: https://gerrit.openafs.org/15754
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-05-30 18:06:34 -04:00
Andrew Deason
236cb51b83 rx: Cleanup and build src/rx/test
We have several programs in src/rx/test that are not built, and have
bitrotted as a result. Clean them up so they can build again, and
make them all build by default.

Some pieces depend on higher-level libraries (libafsrpc) that depend
on rx, so we cannot build all of these during 'make rx'. So create a
new top-level make target, 'rx_test', that just builds the test
programs.

Remove testqueue.c instead of fixing it, since it just tests the old
rx queue implementation, and we already have tests for the newer
opr_queue.

Remove some obsolete references to rxperf/th_rxperf in here; rxperf
has lived in src/tools/ for quite some time.

Change-Id: I8b8b2c0813531ef185d95f4d6fdce6bc69320b80
Reviewed-on: https://gerrit.openafs.org/14749
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-05-23 17:57:32 -04:00
Andrew Deason
4645618ec1 venus: Remove dedebug
This utility has never been built by default, currently does not build
(because RXAFSCB_GetDE doesn't exist), and generates many warnings.
Remove the dead code.

Change-Id: I4c91eb44b3b3c265f0741b9918601abf338b492a
Reviewed-on: https://gerrit.openafs.org/15738
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-04-18 16:50:37 -04:00
Benjamin Kaduk
d6880c7763 build: clean up some more generated files
Commit c1d39153da added a cc-wrapper
script to help generate CTF data for all objects, which is generated
by configure.  Remove it in the distclean target so we don't leave
a stray file hanging around.

Commit 48ce41a447 added a pkgbuild.sh
script, to be used to build packages for newer versions of macOS,
supplementing the buildpkg.sh that was previously used.  Clean it
up in distclean as well (buildpkg.sh was already listed).

Also clean up AFS_component_version_number.c in
libuafs/Makefile.common.in.

These issues were detected while resolving
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1048470 .

Change-Id: I0fea00924a998ee316d48cf76103ea9871a34c6b
Reviewed-on: https://gerrit.openafs.org/15605
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2023-12-23 14:59:17 -05:00
Mark Vitale
6163ebf345 remove vestigial reference to 'sia'
Commit 21006bb844 oops-sias-dead-20080906 removed references to 'sia'
from the tree, but overlooked the reference in the clean2 rule.  This
results in a harmless error from 'make clean', or any target with
'clean' as a dependency:

  /bin/sh: line 0: cd: sia: No such file or directory
  make[1]: [clean2] Error 1 (ignored)

Remove this last reference to eliminate the error.

Change-Id: Ic2827998e3b272acc7714238d0755c5ec2ad2b95
Reviewed-on: https://gerrit.openafs.org/14890
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-02-21 20:40:03 -05:00
Andrew Deason
004c797daa tests: Introduce 'make check TESTS=test/name'
Currently 'make check' always runs all tests. We can run individual
tests manually, but doing so is a bit cumbersome to do under the same
environment as 'make check', since doing so means running something
like this:

    $ MAKECHECK=1 $(abs_top_srcdir)/tests/libwrap @TOP_OBJDIR@/lib \
        ./runtests opr/fmt util/ktime

To make it easier to run single tests introduce a way of calling 'make
check' like this:

    $ make check TESTS='opr/fmt util/ktime'

Which will run the same commands as 'make check', but will run
runtests with only the specified tests, instead of running the default
list.

Some makefiles currently use a "TESTS" or "tests" variable to list
their test binaries; rename them all to "BINS" to avoid conflicting
with this new use for "TESTS" and to make our makefiles a little more
consistent.

Change-Id: I427f83be0d4571794644a97123bcd1f32427bd05
Reviewed-on: https://gerrit.openafs.org/14317
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-11 05:18:49 -04:00
Andrew Deason
0e411a0b36 Remove rpctestlib
There is some code in tests/rpctestlib that appears to be for testing
fileserver RPCs and callback processing, added in commit 262a678d (An
RPC test dispatch library for vice). However, it has never been used,
it seems unlikely that it will be used anytime soon, and it's not
clear if it even works (it contains many hard-coded references to
interfaces and IP addresses).

Just remove the unused code, and some references to rpctestlib. It can
always be added back if needed (or more likely, reimplemented to be
more in line with our current test framework in tests/ ).

Change-Id: Ied3be7474581d8ee75ae000815bb7364d143fd31
Reviewed-on: https://gerrit.openafs.org/14617
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-10 12:59:53 -04:00
Cheyenne Wills
117c35e620 auth_depinstall: Add rxgk_depinstall as dependency
In a clean workspace, a 'make libuafs' fails to build due a missing
header file 'rx/rxgk_types.h' since the file rxgk_types.h was not
installed in the includes directory.  The libuafs target consumes
rxgk_types.h (installed by rxgk_depinstall) indirectly via
auth/cellconfig.p.h that includes rxgk_types.h.

 make libuafs
 ...
 In file included from .../src/afs/UKERNEL/afs_usrops.c:27:
  .../include/afs/cellconfig.h:49:10: fatal error: rx/rxgk_types.h:
  No such file or directory

Add rxgk_depinstall to the list of dependencies for the auth_depinstall
target in the top Makefile to reflect the header dependency.

Change-Id: I01239396c4a5c162b75a29a8e6aaf602b3c1ebb9
Reviewed-on: https://gerrit.openafs.org/14609
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-05-06 00:26:05 -04:00
Mark Vitale
2928dbd78f vol: de-orbit test programs
The updateDirInode and listVicepx utilities are obsolete; they no longer
build, are severely bitrotted, and have been largely replaced by
volscan.

While here, also remove other objects that have not been built by default
since before the original IBM import:
- ILIST		ilist.exe
- NAMEI_PROGS	nicreate, nincdec, nino, nilist

Remove all of them from the tree.

Change-Id: I8f68ec425cce5e84bcc5f41d598eec23102109de
Reviewed-on: https://gerrit.openafs.org/13793
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2020-10-08 00:13:06 -04:00
Michael Meffie
8b68f1a4e1 build: Add rpm target
Add a top-level makefile target to build RPMs for Red Hat distributions
from the currently checked out commit. The resulting rpms are placed in
the packages/rpmbuild/RPMS/<arch> directory.

The rpm target is intended to be a convenience for testing changes to
the rpm packaging or generating packages for local testing.

Change-Id: Id951eb2b03629be59f6258e89e8356fe1fde1ff5
Reviewed-on: https://gerrit.openafs.org/14114
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2020-09-04 10:03:58 -04:00
Michael Meffie
7cc6b97ad2 makesrpm: Support custom version strings
The makesrpm.pl script generates a source RPM by creating a temporary
rpmbuild workspace, populating the SOURCES and SPECS directories in that
workspace, running rpmbuild to build the source RPM, and finally copying
the resulting source RPM out of the temporary workspace.

The name of the source RPM file created by rpmbuild depends on the
package version and release strings. Unfortunately, the format of the
source RPM file name changed around OpenAFS 1.6.0, so makesrpm.pl has
special logic to find the version string and extra code depending on the
detected OpenAFS version.

Instead of trying to predict the name of the resulting source RPM file
from the OpenAFS version string, and having different logic for old
versions of OpenAFS, use a filename glob to find resulting source RPM
file name in the temporary rpmbuild workspace.

Remove the major, minor, and patch level variables, which were only used
to guess the name of the resulting source RPM file name.

Convert '-' characters to '_' in the package version and package
release, since the '-' character is reserved by rpm as a field
separator.

While here, add the --dir option to specify the path of the generated
source RPM, and change the 'srpm' makefile target to use the new --dir
option, instead of changing the current directory before running
makesrpm.pl.  Also, add a dependency on the 'dist' makefile target,
since the the source and document tarballs are required to build the
source RPM.

Add pod documentation and add the --help (-h) option to print a brief
help message, and add the --man option to print the full man page.

With this change, we can build a source RPM even when the .version file
in the src.tar.bz file has a custom format or was created from a
checkout of the master branch or other non-release reference.

Change-Id: I7320afe6ac1f77d4dd38fcc194d41678fde5c950
Reviewed-on: https://gerrit.openafs.org/14116
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2020-09-04 10:02:38 -04:00
Michael Meffie
d0753c0ace make-release: Create output directory if needed
Automatically create the --dir directory if it does not already exist,
which makes this script slightly easier to use. Remove the now
uneeded mkdir from the top-level makefile.

Change-Id: I1f4561120a70263b0b2b194e65fec55fb5666f40
Reviewed-on: https://gerrit.openafs.org/14115
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2020-06-18 20:57:54 -04:00
Andrew Deason
eab0bb0af8 tests: Explicitly build target 'all' by default
Commit 68f40643 (Build tests by default) added new targets in our
top-level Makefile, that caused us to effectively run
'cd tests && make' as part of the default build. Since no explicit
target is provided, 'make' tries to build the first target in the
given Makefile. On some platforms (such as *BSD), 'make' finds the
first defined target as a pattern rule (%.c) from our included
makefiles, and tries to build the target %.c, which it cannot do. This
causes the build to fail with:

    cd tests && make
    make[3]: don't know how to make %.c. Stop

To fix this, just explicitly build the 'all' target when we build our
tests by default.

Change-Id: I319271482685ec35087c470d95fdcaec6e1d8c47
Reviewed-on: https://gerrit.openafs.org/13993
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2020-01-10 16:10:49 -05:00
Andrew Deason
68f406436c Build tests by default
While it's not feasible to run all of our tests by default during the
build, we should be able to at least make sure the tests can build.
So, make the default build targets also build our tests, by making the
'finale' target build the tests.

Change-Id: Ieadd48ba2774526de8a13136e6cc8a50434ed2f5
Reviewed-on: https://gerrit.openafs.org/13941
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2019-12-20 11:32:22 -05:00
Ben Kaduk
4091b9271b Add rxgk support to userok
Change-Id: I5da2a89532453b6bec61fc87218a61455e39f6f0
Reviewed-on: https://gerrit.openafs.org/10576
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2019-03-24 04:49:00 -04:00
Ben Kaduk
69e083d4aa Build rxgk support into libafsrpc
Add a dependency on the appropriate $(GSSAPI_LIBS) and link in the
librxgk_pic.la helper. Careful control of what functions are exposed
allows static linking to continue to work when rxgk is disabled,
though a stub is needed for the case of rxgk_GetServerInfo, so that
there is a symbol present to satisfy the export symbol list.

Consumers of libafsrpc.a need not be modified in accordance
with this change.

Change-Id: I76c0329ba842fb0d4d66534810b114a0813c90a0
Reviewed-on: https://gerrit.openafs.org/10591
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2019-03-24 04:23:56 -04:00
Benjamin Kaduk
20b0f5b4d0 Add rxgk_GetServerInfo stub
Provide a stub function that libafsrpc can export when rxgk support
is disabled.  (It always returns failure, of course.)

Change-Id: Id9f816d25c1a8f56995ec185ae83db0924de0010
Reviewed-on: https://gerrit.openafs.org/12721
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2019-03-24 03:47:55 -04:00
Andrew Deason
ce38ed9529 rxdebug: Add rxgk support
Change-Id: I6ffeb7b36f41816ca1c3d12bb5e8097dd5d7a3fd
Reviewed-on: https://gerrit.openafs.org/12940
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2019-03-24 02:18:03 -04:00
Andrew Deason
809ee49b80 Remove alpha_dux/alpha_osf references
Several files were still referencing the alpha_dux* and alpha_osf*
sysnames. The code for these platforms has been removed, so get rid of
this cruft.

Change-Id: I042fcc29be322bf557829974242553bb6d5b2be4
Reviewed-on: https://gerrit.openafs.org/13339
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2018-09-22 17:05:26 -04:00
Ben Kaduk
7092695909 Add rxgk_crypto_rfc3961.c
rxgk wrappers around an external crypto library, in this case, our
in-tree rfc3961 library.  Primitives for encryption/decryption and
MIC/VerifyMIC, ways to generate and free rxgk_key objects, etc..

Change-Id: I7525086043baf54f5c3019b3f5ab3495760c4236
Reviewed-on: https://gerrit.openafs.org/10565
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
2018-09-14 08:33:33 -04:00
Benjamin Kaduk
9ebff4c6ca OPENAFS-SA-2018-001 audit: support butc types
Add support for several complex butc types to enable butc auditing.

Change-Id: I6aedd933cf5330cda40aae6f33827ae65409df32
2018-09-09 17:35:22 -05:00
Ben Kaduk
03e804b629 Configure glue for rxgk
Add an --enable-rxgk switch to control whether the feature is used.
For the sake of buildbot coverage, we still attempt to build the core
subdirectory provided that a sufficiently usable GSS-API library
is available, but do not install anything when rxgk is disabled at
configure time.  Future commits will use the configure argument to
control the behavior of other rxgk-aware code in the tree.

We provide a few new symbols to conditionally compile code for rxgk.
The two new high-level symbols are:

- AFS_RXGK_ENV: when defined, rxgk is available
- AFS_RXGK_GSS_ENV: when defined, we can use GSS-API calls

AFS_RXGK_GSS_ENV is turned on only for userspace pthread builds. For
now, AFS_RXGK_ENV is only turned on for userspace pthread builds, and
non-ukernel kernel builds. This effectively disables rxgk integration
in any ukernel or LWP code, but this can be changed in the future by
changing when AFS_RXGK_ENV is defined.

Change-Id: Iab661d47aac77c1a238e809362015b869752df18
Reviewed-on: https://gerrit.openafs.org/10564
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2018-08-17 19:40:07 -04:00
Marcio Barbosa
48ce41a447 macos: use pkgbuild to build the package on 10.10/10.11
PackageMaker is no longer part of OS X. As a result, it
is not possible to build the package on OS X 10.10 and
OS X 10.11 using the existing code.

To solve this problem, a new script, along with a couple
of new files, are provided.

- pkgbuild.sh

This script uses the command line tools pkgbuild and
productbuild to build the package on OS X 10.10 and
OS X 10.11. By default, the package built by this
script will not be signed. Optionally, the package
might be signed.

- Distribution.xml

This file is nothing more than an XML file used by
productbuild. It is mainly used to configure how the
installer will look and behave.

- conclusion.txt

Contains the text that is displayed by Installer at
the end of the installation process. Only used by
El Capitan and further.

- Uninstall.14.15

This script can be used by OS X 10.10/10.11 users
to uninstall OpenAFS.

Notes:

- This work is based on a patch made by Brandon Allbery
  <ballbery@sinenomine.net> with fixes and updates from
  Andrew Deason <adeason@dson.org>.

- El Capitan and further prevent us from touching
  /usr/bin directly. As a result, /opt is used.

- If the package is not signed, the user will have
  to disable the OS X security protections. Otherwise,
  the client will not work.

- Now we have two different scripts to build the
  package on OS X. For OS X 10.10 and newer versions,
  pkgbuild.sh will be used. For older versions,
  the existing buildpkg.sh will be used.

Change-Id: If8320666c553b82af450c0263f5e80a00c33e3b8
Reviewed-on: https://gerrit.openafs.org/12239
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2016-07-17 13:44:48 -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
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
Chas Williams (CONTRACTOR)
b9d86a12d1 IRIX: remove mention of unsupported sgiefs from Makefile.in
Change-Id: Ib3594fa5c75df2c10d2692801ed64d657ece5d19
Reviewed-on: http://gerrit.openafs.org/11635
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-01-22 09:42:37 -05:00
Chas Williams (CONTRACTOR)
84422047f4 IRIX: Move src/sgistuff to platform/IRIX
Change-Id: Ie7e17859c346e472af1d07adf2c359250f71d653
Reviewed-on: http://gerrit.openafs.org/11634
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2015-01-22 09:42:00 -05:00
Chas Williams (CONTRACTOR)
00a33b26d7 uss: always build uss
Revert change Ibab1dd189e7fbc41ca01e7ef7479421c056999f5 since uss
should always be safe to build now that its parser symbols are private.

Change-Id: I65fd2008b037dd36a2c7d3ef8817d4d7dda689d7
Reviewed-on: http://gerrit.openafs.org/11653
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
2015-01-07 12:37:41 -05:00
Michael Laß
ada9dba075 Remove traces of Debian packaging
In e34e0d1 the Debian packaging was removed. Some traces are still left, so
remove those as well.

Change-Id: I1d5c22181f59b2bee42dd34c9f3a043297d294a2
Reviewed-on: http://gerrit.openafs.org/11630
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2015-01-04 21:52:47 -05:00
Benjamin Kaduk
0315bb393f Rewrap some long lines in the toplevel Makefile
Only rewrap long lines in make scope; long lines in shell scope
are untouched.

We are inconsistent about whether continuation lines for listing
the dependencies of a target are indented by one or two tabs,
which this commit does not fix.

Change-Id: I2e438a0f42faa2ef7922d2c3b143e14bc82de826
Reviewed-on: http://gerrit.openafs.org/11178
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-01 15:46:07 -05:00
Benjamin Kaduk
81a1a53a36 Clean up our cleaning
'make clean' and 'make maintainer-clean' still leave around a fair
number of droppings, prior to this commit.

We were not descending into the 'tests' top-level directory while
cleaning.  Furthermore, tests/opr/Makefile needed $(LT_CLEAN), and
tests/rx/Makefile needed to spell it correctly.

The libtoolization places a lot of files to be removed in the
'pristine' target.

The processing used to implement the =include directive in the pod
sources for the man pages leaves around the non-.in versions of
files; we should clean that up in the 'pristine' target as well.

The 'pristine' target should likewise remove the man pages which
are generated from the pod files.

Additionally, the documentation build uses a Doxyfile which is
output by configure; that should be removed (if present) by the
'distclean' target.

When hcrypto was converted to libtool, the use of ${OBJECTS} in
the clean target was missed, so we were leaving around most of the
actual object files -- $(LT_CLEAN) does not handle this for us.
Change the rule to remove *.o as is done elsewhere.

The conversion of libafsrpc to libtool added a convenience library
libafsrpc_sys.la, and changed how syscall.o was generated on
most architectures, to be the result of compiling an empty .c file
(instead of just an empty .o file).  This introduced a new
intermediate file, syscall.c, which must be cleaned up.

tvolser was only listing volserver and not vos in its list of
executables to remove while cleaning.

The conversion of venus/test to libtool was not done quite right.
Makefile.libtool and the .lo suffix are only needed when libtool
is being used to link *libraries*; just Makefile.pthread suffices
when libtool is being used to link executables.  As such, remove
the inclusion of Makefile.libtool, and change the .lo targets back
to regular .o ones, and add back *.o to the list of files to remove
in the 'clean' target (it was needed there even without the
other changes to that Makefile).

Change-Id: Ifbc3eee4ad2dce54df991301bc5edd11eb29a24a
Reviewed-on: http://gerrit.openafs.org/11532
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-11-28 18:04:15 -05:00
Benjamin Kaduk
2c3a517e87 Retire Makefile.shared
It has served its purpose, and been replaced by libtool.

Change-Id: Ifb4e2f585fb4239e9138daef82dcc7f41d7f2a99
Reviewed-on: http://gerrit.openafs.org/11485
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-10-15 11:05:08 -04:00
Michael Meffie
25be085209 build: remove trailing whitespace from makefiles
Remove trailing whitespace from the makefiles, except for
trailing whitespace in the boilerplate comment headers.

Change-Id: Ib8ee87a51f00633ba15e1974ac0b311969bef1bf
Reviewed-on: http://gerrit.openafs.org/11456
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>
2014-10-08 10:46:57 -04:00
Ben Kaduk
231bd022ed Dummy Makefile for rxgk
Include a libtool export symbol list for the shared library, which
only has the client RPC calls and the NewFooSecurityObject primitives
for now, since that's all that's stubbed out.

Also connect the rxgk directory up to be buildable from the root, but
nothing depends on it yet so it will not be built.

Looking ahead, build a libafsrpc_rxgk.la object.

Change-Id: I12ddefbdaa1ad4845649e3a32efdeaaa21b5e9b7
Reviewed-on: http://gerrit.openafs.org/10563
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-06-03 08:28:11 -04:00
Benjamin Kaduk
f66c467bdd Use a separate toplevel target for venus/tests
There's no particular reason to lump them in with the venus target,
and we have reports that it causes parallel build failures on some
systems.

Just use a separate 'venustests' target akin to rxtests and ubiktests
and the like, instead.

Some of these lines are now long and should be wrapped, but leave
that for a follow-up commit.

Change-Id: Idd50c02d3c0c88dc2788ecfd221bbc5cbf8cba19
Reviewed-on: http://gerrit.openafs.org/11177
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-05-31 07:32:53 -04:00
Michael Meffie
1141d120a5 doxygen: make dox
Add an optional make target (make dox) and doxygen configuration to
generate doxygen output files.  Auto-detect when the doxygen and
graphviz dot tools are available.  When dot is present, configure
doxygen to create dependency graphs.

Since the graph generation can take a very long time, a new
configure option has been added to override the dot tool
auto-detection. To disable the graph generation (even if dot is
installed), run configure with the option: --without-dot

When graph generation is desired, but graphviz dot is not present in
the PATH, specify the path to dot with the configure option
--with-dot=<path-to-dot>.

The configure summary has been updated to show when doxygen document
and graph generation is configured.

Thank you Jason Edgecombe for providing the doxygen configuration
for OpenAFS.

Change-Id: Ie875fc2961877ee76e4c17631bbb95c29ef20b9e
Reviewed-on: http://gerrit.openafs.org/10970
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-05-28 10:08:16 -04:00
Michael Meffie
2db8242aeb makefile: remove comment about washtool
Once upon a time, AFS used something called washtool as part
of the build system. Remove the remnant comment about it.

Change-Id: I566920b98c03d3cc65a6e2974a78a9247fd79842
Reviewed-on: http://gerrit.openafs.org/10968
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-05-21 07:15:12 -04:00