This is a ground work for adding a local storage backend. As
SecretItem is derived from GDBusProxy, it cannot be simply exposed to
the application through the secret_password_search() if the item is
not backed by the DBus API. This adds an abstract interface
representing a read-only view of a secret item for that purpose.
In file included from /usr/include/libsecret-1/libsecret/secret.h:33,
from ../lib/sync/../ephy-sync-utils.h:24,
from ../lib/sync/ephy-history-manager.c:25:
/usr/include/libsecret-1/libsecret/secret-version.h:19: error: ignoring #pragma __once__ [-Werror=unknown-pragmas]
#pragma __once__
It should be #pragma once, not #pragma __once__.
But let's follow the other public headers here instead.
Added macros:
* SECRET_VERSION_MAJOR
* SECRET_VERSION_MINOR
* SECRET_VERSION_MICRO
* SECRET_CHECK_VERSION
These macros are widely defined in GLib based library. For example,
GLib, GTK, poppler GLib and so on define them.
These macros are useful to detect libsecret version on build type and
from GObject Introspection based bindings.
Linux 3.4 added support for the MADV_DONTDUMP option to madvise(), which
requests that the covered memory not be included in coredumps. It makes
sense to use this to prevent cases where application crashes could
result in secrets being persisted to disk or included in dumps that are
uploaded to remote servers for analysis. I've avoided making this fatal
since there's a chance this code could be built on systems that have
MADV_DONTDUMP but run on systems that don't.
GSimpleAsyncResult is deprecated in favor of the simpler GTask, so use
that instead. This cuts down on the deprecation warnings.
I wanted to do both separately, but porting one without the other led to
some faulty casts from GSimpleAsyncResult to GTask (and vice versa).
Apart from having more developer-friendly messages if the assertions go
wrong, it also prevents the assertions not being run if
`G_DISABLE_ASSERT` is defined (e.g. for performance reasons).
Some distributions patch libgcrypt to provide a pkg-config file, and
disable libgcrypt-config. One of these distributions is Yocto, which we
use as the basis for the GNOME Continuous build environment.
We should check if there's a pkg-config file available for gcrypt, and
use it, falling back to libgcrypt-config if the pkg-config file is not
found.
Commit f36379af33 added the enumeration
GType for SecretCollectionFlags and SecretCollectionCreateFlags in the
introspection data, but by doing so it broke existing users of the
introspected API.
Additionally, the enumeration nicknames—which are used to generate the
enumeration value from the type name and the namespace—were wrong
before, and are wrong now. The idiomatic way to name enumeration members
is to use the uppercase, snake case version of the type name, and append
the value at the end:
SecretCollectionFlags → SECRET_COLLECTION_FLAGS_NONE
SecretCollectionCreateFlags → SECRET_COLLECTION_CREATE_FLAGS_NONE
If this practice is not followed, enumerations should use the
glib-mkenums trigraph and the `prefix` option; this tells glib-mkenums,
and the introspection parser after that, where to cut off the prefix and
which part of the enumeration value should be considered the nickname.
Thus, with `prefix=SECRET_COLLECTION` we can turn:
SECRET_COLLECTION_NONE
into:
Secret.CollectionFlags.NONE
which is the idiomatic form of an enumeration value.
Normally it shouldn't matter too much, but the GIR parser apparently
doesn't like it:
```
/home/niels/gnome/libsecret/libsecret/secret-schema.h:75: syntax error, unexpected ';' in ';' at ';'
/home/niels/gnome/libsecret/libsecret/secret-prompt.h:78: syntax error, unexpected ';' in ';' at ';'
/home/niels/gnome/libsecret/libsecret/secret-value.h:54: syntax error, unexpected ';' in ';' at ';'
/home/niels/gnome/libsecret/libsecret/secret-service.h:307: syntax error, unexpected ';' in ';' at ';'
/home/niels/gnome/libsecret/libsecret/secret-collection.h:176: syntax error, unexpected ';' in ';' at ';'
/home/niels/gnome/libsecret/libsecret/secret-item.h:194: syntax error, unexpected ';' in ';' at ';'
```