diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2014-05-27 13:55:26 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-05-27 21:23:04 +0200 |
commit | 5fc854880db68d9fb887b2d2767906dbf3a1ebe6 (patch) | |
tree | b6f7193ce451dacfc1d3cc52e23de901a7d23df9 | |
parent | 899b9d9c5b995e898fa73e9b59c0e8a7b2804ebe (diff) | |
download | sssd-5fc854880db68d9fb887b2d2767906dbf3a1ebe6.tar.gz sssd-5fc854880db68d9fb887b2d2767906dbf3a1ebe6.tar.xz sssd-5fc854880db68d9fb887b2d2767906dbf3a1ebe6.zip |
sss_autofs: Check return value of autofs make request
The return value of function sss_autofs_make_request was not checked.
(returned value was SSS_STATUS_UNAVAIL)
Unfotunatelly, errnop was zero; buffer "repbuf" was not initialised
and automount crashed in sss_autofs plugin.
Resolves:
https://fedorahosted.org/sssd/ticket/2288
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
(cherry picked from commit 71bcdde36bcfd8cb797777062208a85bf6337dec)
-rw-r--r-- | src/sss_client/autofs/sss_autofs.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/sss_client/autofs/sss_autofs.c b/src/sss_client/autofs/sss_autofs.c index 435cafe23..f86ea867f 100644 --- a/src/sss_client/autofs/sss_autofs.c +++ b/src/sss_client/autofs/sss_autofs.c @@ -88,9 +88,9 @@ _sss_setautomntent(const char *mapname, void **context) rd.data = name; rd.len = name_len + 1; - sss_autofs_make_request(SSS_AUTOFS_SETAUTOMNTENT, &rd, - &repbuf, &replen, &errnop); - if (errnop != 0) { + ret = sss_autofs_make_request(SSS_AUTOFS_SETAUTOMNTENT, &rd, + &repbuf, &replen, &errnop); + if (ret != SSS_STATUS_SUCCESS) { free(name); ret = errnop; goto out; @@ -302,10 +302,10 @@ _sss_getautomntent_r(char **key, char **value, void *context) rd.data = data; rd.len = data_len; - sss_autofs_make_request(SSS_AUTOFS_GETAUTOMNTENT, &rd, - &repbuf, &replen, &errnop); + ret = sss_autofs_make_request(SSS_AUTOFS_GETAUTOMNTENT, &rd, + &repbuf, &replen, &errnop); free(data); - if (errnop != 0) { + if (ret != SSS_STATUS_SUCCESS) { ret = errnop; goto out; } @@ -400,10 +400,10 @@ _sss_getautomntbyname_r(const char *key, char **value, void *context) rd.data = data; rd.len = data_len; - sss_autofs_make_request(SSS_AUTOFS_GETAUTOMNTBYNAME, &rd, - &repbuf, &replen, &errnop); + ret = sss_autofs_make_request(SSS_AUTOFS_GETAUTOMNTBYNAME, &rd, + &repbuf, &replen, &errnop); free(data); - if (errnop != 0) { + if (ret != SSS_STATUS_SUCCESS) { ret = errnop; goto out; } @@ -458,9 +458,9 @@ _sss_endautomntent(void **context) free(fctx->mapname); free(fctx); - sss_autofs_make_request(SSS_AUTOFS_ENDAUTOMNTENT, - NULL, NULL, NULL, &errnop); - if (errnop != 0) { + ret = sss_autofs_make_request(SSS_AUTOFS_ENDAUTOMNTENT, + NULL, NULL, NULL, &errnop); + if (ret != SSS_STATUS_SUCCESS) { ret = errnop; goto out; } |