summaryrefslogtreecommitdiff
path: root/src/sss_client/common.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-12-25 19:14:47 +0100
committerStephen Gallagher <sgallagh@redhat.com>2012-02-05 19:16:16 -0500
commit2cbdd12983eb85eddb90f64cfafb24eae5b448f4 (patch)
tree830ed3f886ba8d8043be5f6272e9105d006b9046 /src/sss_client/common.c
parent1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8 (diff)
downloadsssd-2cbdd12983eb85eddb90f64cfafb24eae5b448f4.tar.gz
sssd-2cbdd12983eb85eddb90f64cfafb24eae5b448f4.tar.bz2
sssd-2cbdd12983eb85eddb90f64cfafb24eae5b448f4.zip
AUTOFS: a client library
This is the library the autofs client is using. automounter dlopen()s the library so there is no header file, no pkgconfig file and the library is in the libsss_autofs package, not in -devel. The library provides the following interface: * _sss_setautomntent() - select the map for processing * _sss_getautomntent_r() - iterates through key/value pairs in the selected map. The key is usually the mount point, the value is mount information (server:/export) * _sss_getautomntbyname_r() - returns value for a specific key. * _sss_endautomntent() deselect a map, clean up
Diffstat (limited to 'src/sss_client/common.c')
-rw-r--r--src/sss_client/common.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/sss_client/common.c b/src/sss_client/common.c
index 998f7c8c..8fe8b44c 100644
--- a/src/sss_client/common.c
+++ b/src/sss_client/common.c
@@ -379,6 +379,8 @@ static bool sss_cli_check_version(const char *socket_name)
expected_version = SSS_PAM_PROTOCOL_VERSION;
} else if (strcmp(socket_name, SSS_SUDO_SOCKET_NAME) == 0) {
expected_version = SSS_SUDO_PROTOCOL_VERSION;
+ } else if (strcmp(socket_name, SSS_AUTOFS_SOCKET_NAME) == 0) {
+ expected_version = SSS_AUTOFS_PROTOCOL_VERSION;
} else {
return false;
}
@@ -830,6 +832,24 @@ int sss_sudo_make_request(enum sss_cli_command cmd,
return ret;
}
+int sss_autofs_make_request(enum sss_cli_command cmd,
+ struct sss_cli_req_data *rd,
+ uint8_t **repbuf, size_t *replen,
+ int *errnop)
+{
+ enum sss_status ret = SSS_STATUS_UNAVAIL;
+
+ ret = sss_cli_check_socket(errnop, SSS_AUTOFS_SOCKET_NAME);
+ if (ret != SSS_STATUS_SUCCESS) {
+ return SSS_STATUS_UNAVAIL;
+ }
+
+ ret = sss_cli_make_request_nochecks(cmd, rd, repbuf, replen, errnop);
+
+ return ret;
+}
+
+
const char *ssscli_err2string(int err)
{
const char *m;