| Line |
Branch |
Exec |
Source |
| 1 |
|
|
/** |
| 2 |
|
|
* This file is part of the CernVM File System. |
| 3 |
|
|
*/ |
| 4 |
|
|
#include <unistd.h> |
| 5 |
|
|
|
| 6 |
|
|
#include <string> |
| 7 |
|
|
|
| 8 |
|
|
#include "helper_log.h" |
| 9 |
|
|
#include "helper_util.h" |
| 10 |
|
|
#include "json.h" |
| 11 |
|
|
typedef struct json_value JSON; |
| 12 |
|
|
|
| 13 |
|
|
using namespace std; // NOLINT |
| 14 |
|
|
|
| 15 |
|
|
|
| 16 |
|
✗ |
int main() { |
| 17 |
|
✗ |
CheckCallContext(); |
| 18 |
|
|
|
| 19 |
|
|
// Handshake |
| 20 |
|
✗ |
string msg = ReadMsg(); |
| 21 |
|
✗ |
ParseHandshakeInit(msg); |
| 22 |
|
✗ |
WriteMsg("{\"cvmfs_authz_v1\":{\"msgid\":1,\"revision\":0}}"); |
| 23 |
|
✗ |
LogAuthz(kLogAuthzDebug | kLogAuthzSyslog, |
| 24 |
|
|
"authz allow helper invoked, connected to cvmfs process %d", |
| 25 |
|
|
getppid()); |
| 26 |
|
|
|
| 27 |
|
|
while (true) { |
| 28 |
|
✗ |
msg = ReadMsg(); |
| 29 |
|
✗ |
LogAuthz(kLogAuthzDebug, "got authz request %s", msg.c_str()); |
| 30 |
|
✗ |
ParseRequest(msg); |
| 31 |
|
✗ |
WriteMsg("{\"cvmfs_authz_v1\":{\"msgid\":3,\"revision\":0,\"status\":0}}"); |
| 32 |
|
|
} |
| 33 |
|
|
|
| 34 |
|
|
return 0; |
| 35 |
|
|
} |
| 36 |
|
|
|