Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Travis with GitHub Actions and fix test failures #855

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: check
on:
push:
pull_request:

jobs:
check_linux:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: apt update
run: sudo apt update

- name: Install dependencies
run: sudo apt install krb5-kdc krb5-admin-server libkrb5-dev liblmdb-dev libnss-wrapper libsocket-wrapper

- name: Build
run: |
autoreconf -fiv
./configure
make check

- name: Upload test artifacts
uses: actions/upload-artifact@v4
with:
name: testdir
path: |
${{ github.workspace }}/tests
!**/w/*
if: always()

check_macos:
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Install dependencies
run: brew install autoconf automake libtool

- name: Build
run: |
autoreconf -fiv
./configure --with-openssl=/opt/homebrew/opt/openssl
make check
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![Build Status:master](https://api.travis-ci.org/cyrusimap/cyrus-sasl.svg?branch=master)](https://travis-ci.org/cyrusimap/cyrus-sasl)

[![build status](https://github.com/cyrusimap/cyrus-sasl/actions/workflows/check.yml/badge.svg)](https://github.com/cyrusimap/cyrus-sasl/actions/workflows/check.yml)

## Cyrus SASL
This is the Cyrus SASL API implementation. It can be used on the client
Expand Down
3 changes: 3 additions & 0 deletions lib/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,9 @@ int sasl_client_start(sasl_conn_t *conn,

myflags = conn->props.security_flags;

/* not a real security flag */
myflags &= ~SASL_SEC_NONSTD_CBIND;

/* if there's an external layer with a better SSF then this is no
* longer considered a plaintext mechanism
*/
Expand Down
3 changes: 3 additions & 0 deletions lib/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,9 @@ static int mech_permitted(sasl_conn_t *conn,
/* special case plaintext */
myflags = conn->props.security_flags;

/* not a real security flag */
myflags &= ~SASL_SEC_NONSTD_CBIND;

/* if there's an external layer this is no longer plaintext */
if ((conn->props.min_ssf <= conn->external.ssf) &&
(conn->external.ssf > 1)) {
Expand Down
28 changes: 18 additions & 10 deletions sasldb/db_gdbm.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ int _sasldb_getdata(const sasl_utils_t *utils,
datum gkey, gvalue;
void *cntxt;
sasl_getopt_t *getopt;
char *reg_path = NULL;
char *path;

if (!utils) return SASL_BADPARAM;
Expand All @@ -89,8 +90,9 @@ int _sasldb_getdata(const sasl_utils_t *utils,
return result;
}

result = _sasldb_getpath(utils, &path);
if (result) goto cleanup;
result = _sasldb_getpath(utils, &reg_path);
if (result) return result;
path = reg_path;

if (utils->getcallback(conn, SASL_CB_GETOPT,
(sasl_callback_ft *)&getopt, &cntxt) == SASL_OK) {
Expand Down Expand Up @@ -142,7 +144,7 @@ int _sasldb_getdata(const sasl_utils_t *utils,
free(gvalue.dptr);

cleanup:
SASLDB_FREEPATH(utils, path);
SASLDB_FREEPATH(utils, reg_path);
utils->free(key);

return result;
Expand All @@ -162,6 +164,7 @@ int _sasldb_putdata(const sasl_utils_t *utils,
datum gkey;
void *cntxt;
sasl_getopt_t *getopt;
char *reg_path = NULL;
char *path;

if (!utils) return SASL_BADPARAM;
Expand All @@ -180,8 +183,9 @@ int _sasldb_putdata(const sasl_utils_t *utils,
return result;
}

result = _sasldb_getpath(utils, &path);
if (result) goto cleanup;
result = _sasldb_getpath(utils, &reg_path);
if (result) return result;
path = reg_path;

if (utils->getcallback(conn, SASL_CB_GETOPT,
(sasl_callback_ft *)&getopt, &cntxt) == SASL_OK) {
Expand Down Expand Up @@ -225,7 +229,7 @@ int _sasldb_putdata(const sasl_utils_t *utils,
gdbm_close(db);

cleanup:
SASLDB_FREEPATH(utils, path);
SASLDB_FREEPATH(utils, reg_path);
utils->free(key);

return result;
Expand All @@ -234,6 +238,7 @@ int _sasldb_putdata(const sasl_utils_t *utils,
LIBSASL_API int _sasl_check_db(const sasl_utils_t *utils,
sasl_conn_t *conn)
{
char *reg_path = NULL;
char *path;
int ret;
void *cntxt;
Expand All @@ -242,8 +247,9 @@ LIBSASL_API int _sasl_check_db(const sasl_utils_t *utils,

if(!utils) return SASL_BADPARAM;

ret = _sasldb_getpath(utils, &path);
ret = _sasldb_getpath(utils, &reg_path);
if (ret) return ret;
path = reg_path;

if (utils->getcallback(conn, SASL_CB_GETOPT,
(sasl_callback_ft *)&getopt, &cntxt) == SASL_OK) {
Expand Down Expand Up @@ -274,7 +280,7 @@ LIBSASL_API int _sasl_check_db(const sasl_utils_t *utils,
"Verifyfile failed");
}
cleanup:
SASLDB_FREEPATH(utils, path);
SASLDB_FREEPATH(utils, reg_path);
return ret;
}

Expand All @@ -288,6 +294,7 @@ typedef struct gdbm_handle
LIBSASL_API sasldb_handle _sasldb_getkeyhandle(const sasl_utils_t *utils,
sasl_conn_t *conn)
{
char *reg_path = NULL;
char *path;
sasl_getopt_t *getopt;
void *cntxt;
Expand All @@ -301,8 +308,9 @@ LIBSASL_API sasldb_handle _sasldb_getkeyhandle(const sasl_utils_t *utils,
return NULL;
}

if (_sasldb_getpath(utils, &path))
if (_sasldb_getpath(utils, &reg_path))
return NULL;
path = reg_path;

if (utils->getcallback(conn, SASL_CB_GETOPT,
(sasl_callback_ft *)&getopt, &cntxt) == SASL_OK) {
Expand Down Expand Up @@ -331,7 +339,7 @@ LIBSASL_API sasldb_handle _sasldb_getkeyhandle(const sasl_utils_t *utils,
}

cleanup:
SASLDB_FREEPATH(utils, path);
SASLDB_FREEPATH(utils, reg_path);
return (sasldb_handle)handle;
}

Expand Down
21 changes: 8 additions & 13 deletions sasldb/db_lmdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ static int do_open(const sasl_utils_t *utils,
sasl_conn_t *conn,
int rdwr, MDB_txn **mtxn)
{
char *reg_path = NULL;
char *path;
void *cntxt;
MDB_env *env;
Expand All @@ -74,22 +75,19 @@ static int do_open(const sasl_utils_t *utils,
int readers = 0;
int ret;
int flags;
int path_needs_freepath = 0;

if (!db_env) {

ret = _sasldb_getpath(utils, &path);
ret = _sasldb_getpath(utils, &reg_path);
if (ret) return ret;
path_needs_freepath = 1;
path = reg_path;

if (utils->getcallback(conn, SASL_CB_GETOPT,
(sasl_callback_ft *)&getopt, &cntxt) == SASL_OK) {
const char *p;
if (getopt(cntxt, NULL, "sasldb_path", &p, NULL) == SASL_OK
&& p != NULL && *p != 0) {
SASLDB_FREEPATH(utils, path);
path = p;
path_needs_freepath = 0;
}
if (getopt(cntxt, NULL, "sasldb_maxreaders", &p, NULL) == SASL_OK
&& p != NULL && *p != 0) {
Expand Down Expand Up @@ -156,10 +154,6 @@ static int do_open(const sasl_utils_t *utils,
}
} else {
env = db_env;
if (path_needs_freepath)
SASLDB_FREEPATH(utils, path);
path = NULL;
path_needs_freepath = 0;
}

ret = mdb_txn_begin(env, NULL, rdwr ? 0 : MDB_RDONLY, &txn);
Expand Down Expand Up @@ -193,8 +187,7 @@ static int do_open(const sasl_utils_t *utils,
ret = SASL_OK;

cleanup:
if (path_needs_freepath)
SASLDB_FREEPATH(utils, path);
SASLDB_FREEPATH(utils, reg_path);
return ret;
}

Expand Down Expand Up @@ -403,6 +396,7 @@ int _sasldb_putdata(const sasl_utils_t *utils,
int _sasl_check_db(const sasl_utils_t *utils,
sasl_conn_t *conn)
{
char *reg_path;
char *path;
int ret;
void *cntxt;
Expand All @@ -411,8 +405,9 @@ int _sasl_check_db(const sasl_utils_t *utils,

if (!utils) return SASL_BADPARAM;

ret = _sasldb_getpath(utils, &path);
ret = _sasldb_getpath(utils, &reg_path);
if (ret) return ret;
path = reg_path;

if (utils->getcallback(conn, SASL_CB_GETOPT,
(sasl_callback_ft *)&getopt, &cntxt) == SASL_OK) {
Expand Down Expand Up @@ -441,7 +436,7 @@ int _sasl_check_db(const sasl_utils_t *utils,
}

cleanup:
SASLDB_FREEPATH(utils, path);
SASLDB_FREEPATH(utils, reg_path);
return ret;
}

Expand Down
Loading