Commit Graph

72 Commits

Author SHA1 Message Date
Wez Furlong
b5b76236e0 eden: adjust volume name on macos
Summary:
The Finder shows the volume name instead of the directory
name when it renders the directory containing a mount, and the default
name of `OSXFuse Volume X` makes it hard to distinguish between multiple
mounts in the same folder.

This changes the volume name to be the basename of the mounted path so
that the finder renders things more reasonably.

Reviewed By: chadaustin

Differential Revision: D14969807

fbshipit-source-id: de9d8469360712828598fed124ed02ee5d6dd44a
2019-04-17 12:54:51 -07:00
Wez Furlong
0f2d07002a eden: allow apple double
Summary:
Unfortunately, some node modules packages include `.DS_Store` files
and since we disable apple double, the kext refuses to allow them to be
unpacked in the repo.  Ideally they wouldn't be in the repo, but we need to
unblock that workflow.

Reviewed By: chadaustin

Differential Revision: D14969808

fbshipit-source-id: f9262294a223fd5cc7929a2b324f2401e1fed083
2019-04-17 12:54:51 -07:00
Yedidya Feldblum
92a8e3f59f Stop checking EventBase::runInEventBaseThread result
Summary:
[Folly] Stop checking `EventBase::runInEventBaseThread` result, as the function will soon be changed not to return any result.

It returned `false` when failing to enqueue a task. But it cannot really fail anyway besides allocation failure, unless in the `EventBase` destructor and while draining and the `AlwaysEnqueue` variant is called.

Reviewed By: andriigrynenko

Differential Revision: D14254969

fbshipit-source-id: a6a9199cbafa18b61488a240e4318ce946953f51
2019-02-28 02:36:15 -08:00
Chad Austin
015c45872b split privhelper and privhelper_base
Summary:
We're not that far from building privhelper on mode/mac but it does
require figuring out how to depend on osxfuse from the Buck build, so
bypass that by breaking the inodes target's dependency on privhelper's
<fuse_ioctl.h> include.

Reviewed By: strager

Differential Revision: D14218709

fbshipit-source-id: edbb2a21df06d6f2a4f860ef13718ad05d445e98
2019-02-27 19:06:00 -08:00
Chad Austin
b8dc8a80c3 only include selinux on linux
Summary: We should only attempt to include selinux on Linux, not macOS.

Reviewed By: strager

Differential Revision: D14181109

fbshipit-source-id: be47b7bdadc3409577fa114559e905214848ebd8
2019-02-22 16:14:48 -08:00
Michael Liu
b626f922ce Apply modernize-use-override (2nd iteration)
Summary:
Use C++11’s override and remove virtual where applicable.
Change are automatically generated.

Reviewed By: simpkins

Differential Revision: D14087291

fbshipit-source-id: 80e6a393c5ed8ea1656855da3832bcee10635004
2019-02-14 17:29:27 -08:00
Matt Glazar
0b151df7b3 Delete unused function declaration
Summary: PrivHelperServer::initLogging is declared in the .h file, but it's never defined. Remove the useless declaration.

Reviewed By: simpkins

Differential Revision: D13814416

fbshipit-source-id: 25cb47442a19947da08d13d9bed9b4631a1c9739
2019-01-28 11:32:56 -08:00
Jon Maltiel Swenson
79b7db4d91 Make EventBase destruction callbacks safely cancellable
Summary: Currently, `runOnDestruction` aims to be thread-safe; new callbacks are added to the `onDestructionCallbacks_` list while the associated mutex is held. However, the caller may own the `LoopCallback` and wish to destroy/cancel it before the `EventBase` destructor runs, and this callback cancellation is not thread-safe, since unlinking does not happen under the lock protecting `onDestructionCallbacks_`. The primary motivation of this diff is to make on-destruction callback cancellation thread-safe; in particular, it is safe to cancel an on-destruction callback concurrently with `~EventBase()`.

Reviewed By: spalamarchuk

Differential Revision: D13440552

fbshipit-source-id: 65cee1e361d37647920baaad4490dd26b791315d
2019-01-24 15:57:39 -08:00
Wez Furlong
2ba72dc18e eden: have priv helper load the fuse kext if needed
Summary:
This is something that is not needed on linux because
the kernel module is typically already loaded (at least on the systems
on which we run).

On macos, since fuse is not part of the kernel, libfuse has some code
that loads it when needed.

This diff performs the equivalent actions for eden.

Reviewed By: simpkins

Differential Revision: D13721489

fbshipit-source-id: 627bc90681141d0e7da3d5b5e06756a36839958c
2019-01-17 18:52:53 -08:00
Wez Furlong
4e596a944b eden: implement mount/unmount for osxfuse
Summary:
Note that the concept of bind mounts doesn't exist on macos, so that
portion of the server just throws.

Reviewed By: simpkins

Differential Revision: D13480147

fbshipit-source-id: 92225188c0af42574d090004490f3926d393747b
2019-01-17 18:52:53 -08:00
Wez Furlong
13c2d03331 eden: fixup compilation warning with clang
Summary:
Address this error with clang:

```
In file included from /Users/wez/fbsource/fbcode/eden/oss/eden/fs/service/main.cpp:25:
/Users/wez/fbsource/fbcode/eden/oss/eden/fs/fuse/privhelper/PrivHelper.h:22:1: warning: class 'Unit' was previously declared as a struct [-Wmismatched-tags]
class Unit;
^
/Users/wez/fbsource/fbcode/eden/oss/external/install/include/folly/Unit.h:36:8: note: previous use is here
struct Unit {
       ^
/Users/wez/fbsource/fbcode/eden/oss/eden/fs/fuse/privhelper/PrivHelper.h:22:1: note: did you mean struct here?
class Unit;
^~~~~
struct
```

Reviewed By: strager

Differential Revision: D13602383

fbshipit-source-id: 6e69716498680660181ab441c3c007b074ec1d40
2019-01-14 13:52:36 -08:00
Wez Furlong
0774b2c457 eden: pull in osxfuse kernel headers
Summary:
There's nothing nice about this; the full set of kernel headers are
not installed with the binary distribution, and since the kernel distribution
has to be signed to be loaded on osx, there's no benefit to us building it
for ourselves.

This diff adds a nop builder and tweaks the cmake to point into the osxfuse
repo.

The osxfuse repo aggregates a couple of related repos using the git
submodule feature, so trigger that from getdeps.py too.

Reviewed By: strager

Differential Revision: D13480148

fbshipit-source-id: 84e09a86f6a83f83ffd1e3fe113dc7b15b3ea208
2018-12-17 20:16:19 -08:00
Wez Furlong
b69536b6d4 eden: no SOCK_CLOEXEC on darwin
Summary:
handle this best-effort by setting this bit on each fd after
allocating them.

Reviewed By: strager

Differential Revision: D13475712

fbshipit-source-id: 46be80f025b21967f75822f983bc327c5e2d20af
2018-12-17 20:16:18 -08:00
Wez Furlong
ae390beb6e eden: prctl is linux specific
Summary: only include and use it on linux

Reviewed By: simpkins

Differential Revision: D13475715

fbshipit-source-id: 6b0b9da1b32088e01cbb932f9b3ed62532dfe00f
2018-12-15 13:43:31 -08:00
Wez Furlong
31eb2b1c8c eden: selinux is linux specific, adjust cmake accordingly
Summary: only add the selinux deps if we found selinux

Reviewed By: simpkins

Differential Revision: D13475711

fbshipit-source-id: c3375282b61881317f9a6c4c8e321ce717d1f9ab
2018-12-15 13:43:31 -08:00
Chad Austin
8cf1e44823 folly::Optional -> std::optional
Summary: Eden's on C++17 so fully cross the rubicon!

Reviewed By: strager

Differential Revision: D10498098

fbshipit-source-id: 33a885614d627399645b70a54092c1badd795fbe
2018-10-23 18:51:59 -07:00
Adam Simpkins
2904016208 cmake: fix the build when SELinux is available
Summary:
D9029272 (github commit fae2056037) accidentally broke the CMake-based
build of Eden when SELinux is available: it defined `PRIVHELPER_LIBS` but
later used `PRIVHELPER_LIBRARIES` (LIBS vs LIBRARIES).

This fixes that error by simply removing this intermediate variable.  We
can just use SELINUX_INCLUDE_DIR and SELINUX_LIBRARIES directly, as they
will simply be empty if SELinux is not available.

Reviewed By: quark-zju

Differential Revision: D10503905

fbshipit-source-id: 1c12bb1cad0351e4e0a77d0c7e8a83086209efee
2018-10-23 13:42:12 -07:00
Chad Austin
88b08e5b00 clang-format
Summary: We've diverged in a few places from clang-format, so run it across the entirety of Eden.

Reviewed By: wez

Differential Revision: D10137785

fbshipit-source-id: 9603c2eeddc7472c33041ae60e3e280065095eb7
2018-10-02 10:07:38 -07:00
Wez Furlong
8cc1170bf7 tolerate ECHILD when waiting on privhelper process
Summary:
Since the privhelper process is often not our direct child
we both cannot and do not need to wait for it, so treat ECHILD as
a successful exit status to prevent bubbling up an exception that
blocks graceful restart.

Reviewed By: simpkins

Differential Revision: D9581473

fbshipit-source-id: 6d53bbb6ee2043de76df9c6870028a1c15571dac
2018-08-30 17:28:10 -07:00
Lee Howes
c0a837ec7d Future<T>::then Future<T>::then(not-try-task) -> Future<T>::thenValue(task).
Summary:
Overall plan to modify Future<T>::then to be r-value qualified and use Future<T>::thenTry or Future<T>::thenValue.

The goal is to disambiguate folly::Future and to improve type and lifetime safety of Future and its methods.

Codemod:
 * future<T>.then(callable with operator()(not-a-try)) to future<T>.thenValue(callable with operator()(not-a-try)).
 * future<T>.then(callable with operator()()) to future<T>.thenValue(callable with operator()(auto&&)).
 * future<T>.then(callable with operator()(auto)) to future<T>.thenValue(callable with operator()(auto)).

Reviewed By: yfeldblum

Differential Revision: D9512177

fbshipit-source-id: daa3581611dcd9f32d9314bae1c5fa0f966613f3
2018-08-26 22:52:34 -07:00
Marshall Cline
dfac9dda4a use rvalue-qual Future::ensure(): pass 2
Summary:
This is part of "the great r-valuification of folly::Future":

* This is something we should do for safety in general.
* Several of folly::Future's methods are lvalue-qualified even though they act as though they are rvalue-qualified, that is, they provide a postcondition that says, in effect, callers should act as though the method invalidated its `this` object (regardless of whether that invalidation was actual or logical).
* This violates the C++ principle to "Express ideas directly in code" (see Core Guidelines), and generally makes it more confusing for callers as well as hiding the actual semantics from tools (linters, compilers, etc.).
* This dichotomy and confusion has manifested itself by some failures around D7840699 since lvalue-qualification hides that operation's move-out semantics - leads to some use of future operations that are really not correct, but are not obviously incorrect.
* The goal of rvalueification is to make sure methods that are logically rvalue-qualified are actually rvalue-qualified, which forces callsites to acknowledge that rvalueification, e.g., `std::move(f).ensure(...)` instead of `f.ensure(...)`. This syntactic change in the callsites forces callers to acknowledge the method's rvalue semantics.

This diff started as a Codemod, then required manual fixes. Here were the codemod steps:

* expr.ensure(...) ==> std::move(expr).ensure(...)  // if expr is not already an xvalue
* expr->ensure(...) ==> std::move(*expr).ensure(...)

Note: operator precedence of that last step is safe - no need to parenthesize `expr`. Reason: `->` binds more tightly than unary `*`.

Reviewed By: yfeldblum

Differential Revision: D9332070

fbshipit-source-id: 882121fe82c05fdb196ce676db686b6bc254974b
2018-08-16 20:37:45 -07:00
Chad Austin
a541b15818 hide setcon() failure messages at startup by default
Summary:
The setcon() failure is not actionable or interesting, so don't log it
to stdout at Eden startup.

Reviewed By: wez

Differential Revision: D9344467

fbshipit-source-id: 68435c8f22c228f2fbb86f37c2b1874723934169
2018-08-15 13:52:06 -07:00
Lee Howes
69d8203162 Future<T>::then 6/n: Future<T>::then() & -> Future<T>::then() &&.
Summary:
Overall plan to modify Future<T>::then to be r-value qualified and use Future<T>::thenTry or Future<T>::thenValue.

The goal is to disambiguate folly::Future and to improve type and lifetime safety of Future and its methods.

6/n: Codemod rvalue-future<T>.then(...) to rvalue-future<T>.then(...).

Reviewed By: yfeldblum

Differential Revision: D9152002

fbshipit-source-id: 166475c1dcafb29a11154cbfbdf7e2e1feaf745b
2018-08-03 23:36:16 -07:00
Jun Wu
fae2056037 do not require SELinux in GitHub build
Summary:
I tried to build eden using GitHub version and ran into SELinux issues.
This patch fixed related issues, namely:

- `set(X Y)` sets X to string literal Y. Change it to `set(X ${Y})`.
- `SELINUX_INCLUDE_DIR` could be undefined. Check before use it.
- `./eden/fs/eden-config.h` and `./build/eden/fs/eden-config.h` both exist and
  the former is used. Set include dirs so the latter gets used.

Reviewed By: bolinfest

Differential Revision: D9029272

fbshipit-source-id: 0c94bbe2f9e3fa90973802ddde16ad4d9ddfc0e8
2018-07-27 13:22:57 -07:00
Lee Howes
ac9b8ac398 Future<T>::then 3/n: Future<T>::then(not-try-task) -> Future<T>::thenValue(task).
Summary:
Overall plan to modify Future<T>::then to be r-value qualified and use Future<T>::thenTry or Future<T>::thenValue.

The goal is to disambiguate folly::Future and to improve type and lifetime safety of Future and its methods.

3/n: Codemod rvalue-future<T>.then(callable with operator()(not-a-try)) to rvalue-future<T>.thenValue(callable with operator()(not-a-try)).

Reviewed By: yfeldblum

Differential Revision: D8986716

fbshipit-source-id: 906339d9ffb90b3c38a24ce8bf0cef7be318d946
2018-07-24 23:36:23 -07:00
Marshall Cline
08c0cccb75 use rvalue-qual Future::get(): pass 2
Summary:
This is part of "the great r-valuification of folly::Future":

* https://fb.facebook.com/groups/fbcode/permalink/1726007767436055/
* This is something we should do for safety in general.
* Using lvalue-qualified `Future::get()` has caused some failures around D7840699 since lvalue-qualification hides that operation's move-out semantics - leads to some use of future operations that are really not correct, but are not obviously incorrect.
* Drill-down: `Future::get() &` moves-out the result but doesn't invalidate the Future - the Future remains (technically) valid even though it actually is partially moved-out. Callers can subsequently access that moved-out result via things like `future.get()`, `future.result()`, etc., which will cause surprising results - accessing an already-moved-out result. The semantics of `Future::get() &&` are more obvious: it moves-out the Future, leaving it with `future.valid() == false`.

Codemod steps (where `get(...)` means both `Future::get()` and `Future::get(Duration)`):

* expr.get(...) ==> std::move(expr).get(...)  // if expr is not already an xvalue
* expr->get(...) ==> std::move(*expr).get(...)

Note: operator precedence of that last step is safe - no need to parenthesize `expr`. Reason: `->` binds more tightly than unary `*`.

Reviewed By: yfeldblum

Differential Revision: D8625157

fbshipit-source-id: 70323ff3189631ce5597d3c9b17629c99f5d457b
2018-06-27 13:51:16 -07:00
Marshall Cline
9825a9fd3f modernize Future::get(): 4/n = codemod to std::move for non-ptr exprs
Summary:
Codemod non-pointer expressions:
   - expr.get() ==> std::move(expr).get()
   - expr.get(dur) ==> std::move(expr).get(dur)
when expr is not already an xvalue.

Reviewed By: yfeldblum

Differential Revision: D8429621

fbshipit-source-id: 87dea0749509d7083f14be93505ffff14ae8d464
2018-06-19 23:21:11 -07:00
Adam Simpkins
31321c3460 fork the privhelper process at the very start of main()
Summary:
Update edenfs to fork the privhelper process as the first thing we do, before
calling folly::init().  This allows us to drop privileges before processing
command line arguments and doing any other startup work.

Reviewed By: wez

Differential Revision: D8212778

fbshipit-source-id: d67e3700305fdb01cb6188645b37875ceb53d21f
2018-06-18 17:22:18 -07:00
Adam Simpkins
f2b4038361 add a privhelper call to set the log file
Summary:
Add a call to tell the privhelper process to redirect its log messages to a
different file handle.

This call will make it possible for the privhelper processed to be forked
before the main edenfs process has processed the --logPath argument.  The main
edenfs process can now drop privileges before it processes arguments and opens
the log file, and it can then pass the file handle to the privhelper process.

Reviewed By: wez

Differential Revision: D8212776

fbshipit-source-id: 3ec6bfc82ee090216d66c5bfd1b8c2b8819c1f45
2018-06-18 17:22:18 -07:00
Adam Simpkins
dc84937e0b update PrivHelper to support detaching from an EventBase
Summary:
Add a PrivHelper::detachEventBase() method, and rename PrivHelper::start() to
attachEventBase().

This makes it possible to detach a running PrivHelper from its EventBase and
re-attach it to an EventBase later to restart it.  This will be useful in
upcoming diffs to allow performing calls to the PrivHelper before the main
thrift server EventBase has started.

Reviewed By: wez

Differential Revision: D8212777

fbshipit-source-id: d5a9bf672afa8b16e53201ac747d77337e1cc307
2018-06-18 17:22:18 -07:00
Adam Simpkins
011cc21e52 update privhelper code to use the UnixSocket helper class
Summary:
This updates the privhelper code to use the UnixSocket class for performing
I/O.  This reduces the number of separate implementations of code we have for
sending file descriptors across Unix domain sockets, and also makes the
privhelper APIs non-blocking.

This will make it easier to clean up some of the initialization ordering in
the future.  It will also make it easier to send file descriptors to the
privhelper server, instead of just receiving them.  This may be helpful for
passing a file descriptor to use for logging to the privhelper process, which
will make it easier to fork the privhelper before logging redirection has
occurred.

Reviewed By: bolinfest

Differential Revision: D8053422

fbshipit-source-id: 1f8fdf22afc797eead0213be1352ea530762140d
2018-06-11 18:32:25 -07:00
Adam Simpkins
5305edefc1 update PrivHelper APIs to return Futures
Summary:
Up until now all of the privhelper APIs have been blocking calls.  This
changes the privhelper functions to return Futures, and updates all users of
these APIs to be able to handle the results using Futures.

One benefit of this change is that all existing mount points are remounted in
parallel now during startup, rather than being mounted serially.  The old code
performed a blocking `get()` call on the future returned by
`EdenServer::mount()`.

The privhelper calls themselves are still blocking for now--they block until
complete and always return completed Future objects.  I will update the
privhelper code in a subsequent diff to actually make it asynchronous.

Reviewed By: bolinfest

Differential Revision: D8053421

fbshipit-source-id: 342d38697f67518f6ca96a37c12dd9812ddb151d
2018-06-11 18:32:25 -07:00
Sergey Zhupanov
419a57b1bc Enabled additional compiler warnings in Eden.
Summary:
1. Enabled a number of additional C++ compiler warnings in Eden.
2. Fixed warnings-turned-errors that resulted from this change.

Reviewed By: simpkins

Differential Revision: D8132543

fbshipit-source-id: 2290ffaaab55024d582e29201a1bcaa1152e6b3e
2018-06-01 11:39:01 -07:00
Adam Simpkins
684fa29593 update folly::Init to call folly::initLogging()
Summary:
Update the folly::Init code to define a `--logging` command line flag, and call
`folly::initLoggingOrDie()` with the value of this command line during
initialization.

This is similar to the existing code that initializes the glog library.
(Programs can use both glog and folly logging together in the same program, and
I expect that many programs will do so as parts get converted to folly::logging
and parts remain using glog.)

Reviewed By: yfeldblum

Differential Revision: D7827344

fbshipit-source-id: 8aa239fbad43bc0b551cbe40cad7b92fa97fcdde
2018-05-15 12:38:01 -07:00
Adam Simpkins
8e3c09a99a move folly/experimental/logging to folly/logging/
Summary:
Promote the folly logging code out of the experimental subdirectory.
We have been using this for several months in a few projects and are pretty
happy with it so far.

After moving it out of the experimental/ subdirectory I plan to update
folly::Init() to automatically support configuring it via a `--logging` command
line flag (similar to the initialization it already does today for glog).

Reviewed By: yfeldblum, chadaustin

Differential Revision: D7755455

fbshipit-source-id: 052db34c97f7516728f7cbb1a5ad959def2f6efb
2018-04-30 21:29:29 -07:00
Adam Simpkins
dea514bbef add CMake build files
Summary: Add CMakeFiles to build Eden.

Reviewed By: wez

Differential Revision: D7479587

fbshipit-source-id: 7e0b4a756005dadc3af5c13c36ce22d1dcc15071
2018-04-30 14:37:46 -07:00
Adam Simpkins
19122feb19 add a FOLLY_INIT_LOGGING_CONFIG() helper macro
Summary:
Add a macro to help users define the `getBaseLoggingConfig()` function.

While I would prefer to avoid macros if possible, this seems worthwhile.  This
saves 4 or 5 lines of boilerplate code in each program that sets a custom base
logger setting.  It also reduces the likelihood of a developer accidentally
having a typo in the function name, which would still build successfully but
not have the desired results.

Reviewed By: chadaustin

Differential Revision: D7457652

fbshipit-source-id: 1c316c7ea6949c16bd7b61c0440cc1ee69ecb83e
2018-04-10 11:42:27 -07:00
Adam Simpkins
f5f0f5f9c8 use folly::getBaseLoggingConfig() to set base logging config
Summary:
Set the default logging settings by overriding folly::getBaseLoggingConfig()
rather than by setting a default value for the `--logging` command line
argument.

This has two advantages:
- Custom logging settings supplied in the `--logging` argument will now
  combined with the base logging settings rather than completely replacing
  them.  Previously users had to always add "eden=DBG2" to this argument if
  they did not want to drop this setting.
- This will make it possible to move the definion of the `--logging` flag to
  folly::Init and not lose our custom settings for Eden.

Reviewed By: yfeldblum

Differential Revision: D7348519

fbshipit-source-id: bd9012f387b0460da8bcc9c7c31aef46b1abec5c
2018-03-21 12:37:48 -07:00
Adam Simpkins
28426f4d29 throw all errno exceptions as std::generic_category
Summary:
Fix the code to generate exceptions based on an errno error using
std::generic_category rather than std::system_category.

Reviewed By: yfeldblum

Differential Revision: D7329997

fbshipit-source-id: 3fe257bbbc7a631c801f31120592c8bdbc25c8bf
2018-03-20 13:38:45 -07:00
Adam Simpkins
a3c582d708 check for std::generic_category when looking for errno errors
Summary:
Add a new utils/SystemError.h header with helper functions to check if a
`std::system_error` contains an errno value.

Most of the code in Eden previously only checked for `std::system_category`
when looking for errno values.  `std::generic_category` is the correct category
to use for errno exceptions, but folly/Exception.h incorrectly throws them as
`std::system_category` today.  This change makes Eden treat either error type
as errno values for now.

Reviewed By: yfeldblum

Differential Revision: D7329999

fbshipit-source-id: 67a3c3ea10371c53a2e34236b7575deac4cbd53a
2018-03-20 13:38:45 -07:00
Adam Simpkins
bfcf4c574a remove the fusell namespace
Summary: Move everything in the `facebook::eden::fusell` namespace to `facebook::eden`

Reviewed By: chadaustin

Differential Revision: D7314458

fbshipit-source-id: db56d3e5fb898235e1376ac76077cf780d9b4698
2018-03-19 17:01:52 -07:00
Chad Austin
7c505e7933 don't swallow sudo's stdout and stderr in eden daemon
Summary:
If you run `eden daemon` on a machine where sudo needs input, sudo's
output would get redirected to edenfs.log and eden daemon would appear
to hang.  Worse, if you pressed ctrl-C, sudo would remain in the
background and continue to swallow keypresses from the tty, appearing
to somewhat break your shell until it gave up.  The fix is to stop
redirecting stdout and stderr from Python and instead have edenfs
redirect itself into the log if given.

Reviewed By: simpkins

Differential Revision: D7223399

fbshipit-source-id: bae17b150b6594a3dd87bb88741c8dcefd1c5213
2018-03-14 12:46:19 -07:00
Chad Austin
5d02bc5cb2 allow attaching to edenfs with non-root gdb
Summary:
We were curious why we needed `sudo gdb` to debug Eden even
though it drops privileges. The process dumpable bit is the trick.

Reviewed By: simpkins

Differential Revision: D7182742

fbshipit-source-id: 48e3dd778bf07ec1bfadace4edeb64668b936b9b
2018-03-07 23:11:48 -08:00
Chad Austin
ba7e628e69 drop selinux privileges too
Summary:
Today, attaching gdb to edenfs requires sudo. Our hypothesis is that,
even though we drop uid and gid, the SELinux context remains elevated,
preventing ptrace from attaching.

Reviewed By: simpkins

Differential Revision: D7128692

fbshipit-source-id: 0f9b9a2ebef5a438bf0f4dcdc00a7b703a7aea02
2018-03-07 11:16:40 -08:00
Adam Simpkins
21d2b6c46d Remove TARGETS files
Summary:
This removes the TARGETS files from the eden github repository.  The
open source buck build has been failing for several months, since buck
removed support for the thrift_library() rule.

I will potentially take a stab at adding CMake build support for Eden
at some point in the future.

Reviewed By: chadaustin

Differential Revision: D6893233

fbshipit-source-id: e6023094a807cf481ac49998c6f21b213be6c288
2018-02-20 19:57:45 -08:00
Adam Simpkins
fe1c35f781 move the privhelper APIs into a PrivHelper class
Summary:
Move all of the privhelper functionality into a PrivHelper class.  The
ServerState object now stores the PrivHelper object to use, rather than having
a global singleton.

This will make it easier to stub out the PrivHelper functionality during unit
tests.

Reviewed By: wez

Differential Revision: D6929862

fbshipit-source-id: e3edcb0a03ba9afdf34554cb961fd74557cdd6e3
2018-02-08 19:36:03 -08:00
Adam Simpkins
4fb0ac3809 logging: update LoggerDB::get() to return a reference
Summary:
Change `LoggerDB::get()` to a reference instead of a pointer since this
function can never return null.

Reviewed By: yfeldblum

Differential Revision: D6893206

fbshipit-source-id: af47063918a79c851fd39b838d6c63755166e033
2018-02-06 12:51:07 -08:00
Chad Austin
697eb8a6fd run clang-format across eden
Summary:
```
find . \( -iname '*.cpp' -o -iname '*.h' \) -exec arc lint --apply-patches {} +
```

Differential Revision: D6820436

fbshipit-source-id: 173c0e3b5c023c1c9276f34e17d732f1dd161892
2018-01-26 11:20:31 -08:00
Sergey Zhupanov
ea2994c045 Misc cleanup of cpp files in eden/fs/fuse/
Summary: Misc cleanup (mainly constification).

Reviewed By: simpkins

Differential Revision: D6720987

fbshipit-source-id: c9c719fce93d413857c48c61e0c920319e865209
2018-01-17 13:41:19 -08:00
Sergey Zhupanov
09f8707b81 Minor refactor replacing if with switch and a loop control comparison.
Summary: Minor refactor replacing if with switch and a loop control comparison.

Reviewed By: wez

Differential Revision: D6730849

fbshipit-source-id: 69ac7be9fae3be6274b56dd2baea433ed2437f7c
2018-01-16 18:48:08 -08:00