summaryrefslogtreecommitdiffstats
path: root/src/providers/proxy/proxy_id.c
diff options
context:
space:
mode:
authorJan Zeleny <jzeleny@redhat.com>2011-10-31 04:14:25 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-11-07 08:57:17 -0500
commit72c3fe563ad7a59b65ae7fa757fc602fe26164c2 (patch)
tree145fd2ab7c648122e1a85c60be95ad9ce2ca64ff /src/providers/proxy/proxy_id.c
parent5a66e8f96603b34497de8fed762a9ac41e929efa (diff)
downloadsssd-72c3fe563ad7a59b65ae7fa757fc602fe26164c2.tar.gz
sssd-72c3fe563ad7a59b65ae7fa757fc602fe26164c2.tar.xz
sssd-72c3fe563ad7a59b65ae7fa757fc602fe26164c2.zip
Fixed empty loginShell in proxy provider
https://fedorahosted.org/sssd/ticket/892
Diffstat (limited to 'src/providers/proxy/proxy_id.c')
-rw-r--r--src/providers/proxy/proxy_id.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/src/providers/proxy/proxy_id.c b/src/providers/proxy/proxy_id.c
index 54f71426b..c7fdf356c 100644
--- a/src/providers/proxy/proxy_id.c
+++ b/src/providers/proxy/proxy_id.c
@@ -42,6 +42,7 @@ static int get_pw_name(TALLOC_CTX *mem_ctx,
char *buffer;
size_t buflen;
int ret;
+ const char *shell;
DEBUG(7, ("Searching user by name (%s)\n", name));
@@ -97,6 +98,12 @@ static int get_pw_name(TALLOC_CTX *mem_ctx,
break;
}
+ if (pwd->pw_shell && pwd->pw_shell[0] != '\0') {
+ shell = pwd->pw_shell;
+ } else {
+ shell = NULL;
+ }
+
ret = sysdb_store_user(sysdb,
pwd->pw_name,
pwd->pw_passwd,
@@ -104,7 +111,7 @@ static int get_pw_name(TALLOC_CTX *mem_ctx,
pwd->pw_gid,
pwd->pw_gecos,
pwd->pw_dir,
- pwd->pw_shell,
+ shell,
NULL, NULL,
ctx->entry_cache_timeout,
0);
@@ -163,6 +170,7 @@ static int get_pw_uid(TALLOC_CTX *mem_ctx,
size_t buflen;
bool del_user = false;
int ret;
+ const char *shell;
DEBUG(7, ("Searching user by uid (%d)\n", uid));
@@ -213,6 +221,12 @@ static int get_pw_uid(TALLOC_CTX *mem_ctx,
break;
}
+ if (pwd->pw_shell && pwd->pw_shell[0] != '\0') {
+ shell = pwd->pw_shell;
+ } else {
+ shell = NULL;
+ }
+
ret = sysdb_store_user(sysdb,
pwd->pw_name,
pwd->pw_passwd,
@@ -220,7 +234,7 @@ static int get_pw_uid(TALLOC_CTX *mem_ctx,
pwd->pw_gid,
pwd->pw_gecos,
pwd->pw_dir,
- pwd->pw_shell,
+ shell,
NULL, NULL,
ctx->entry_cache_timeout,
0);
@@ -272,6 +286,7 @@ static int enum_users(TALLOC_CTX *mem_ctx,
char *buffer;
char *newbuf;
int ret;
+ const char *shell;
DEBUG(7, ("Enumerating users\n"));
@@ -354,6 +369,12 @@ again:
goto again; /* skip */
}
+ if (pwd->pw_shell && pwd->pw_shell[0] != '\0') {
+ shell = pwd->pw_shell;
+ } else {
+ shell = NULL;
+ }
+
ret = sysdb_store_user(sysdb,
pwd->pw_name,
pwd->pw_passwd,
@@ -361,7 +382,7 @@ again:
pwd->pw_gid,
pwd->pw_gecos,
pwd->pw_dir,
- pwd->pw_shell,
+ shell,
NULL, NULL,
ctx->entry_cache_timeout,
0);
@@ -883,6 +904,7 @@ static int get_initgr(TALLOC_CTX *mem_ctx,
char *buffer;
size_t buflen;
int ret;
+ const char *shell;
tmpctx = talloc_new(mem_ctx);
if (!tmpctx) {
@@ -935,6 +957,12 @@ static int get_initgr(TALLOC_CTX *mem_ctx,
break;
}
+ if (pwd->pw_shell && pwd->pw_shell[0] != '\0') {
+ shell = pwd->pw_shell;
+ } else {
+ shell = NULL;
+ }
+
ret = sysdb_store_user(sysdb,
pwd->pw_name,
pwd->pw_passwd,
@@ -942,7 +970,7 @@ static int get_initgr(TALLOC_CTX *mem_ctx,
pwd->pw_gid,
pwd->pw_gecos,
pwd->pw_dir,
- pwd->pw_shell,
+ shell,
NULL, NULL,
ctx->entry_cache_timeout,
0);