summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2005-11-29 22:46:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:39 -0500
commite789a870f185227f44f950261d54b1d02e6f5a8f (patch)
tree3d0490674710f339cd464af8231fd4646b2ab38f /source3
parent05fafb83968a31907d996d37b91bdd9b72998701 (diff)
downloadsamba-e789a870f185227f44f950261d54b1d02e6f5a8f.tar.gz
samba-e789a870f185227f44f950261d54b1d02e6f5a8f.tar.bz2
samba-e789a870f185227f44f950261d54b1d02e6f5a8f.zip
r11960: add 'wbinfo --separator' to get the currently active winbind_separator.
Needed for KDM/GDM login masks. Guenther (This used to be commit abf761c8bf5e8cd3b0aba66abd5fd896035ea1ac)
Diffstat (limited to 'source3')
-rw-r--r--source3/nsswitch/wbinfo.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c
index 45195fb86a..aae76e4423 100644
--- a/source3/nsswitch/wbinfo.c
+++ b/source3/nsswitch/wbinfo.c
@@ -30,7 +30,7 @@
extern int winbindd_fd;
-static char winbind_separator(void)
+static char winbind_separator_int(BOOL strict)
{
struct winbindd_response response;
static BOOL got_sep;
@@ -46,6 +46,9 @@ static char winbind_separator(void)
if (winbindd_request_response(WINBINDD_INFO, NULL, &response) !=
NSS_STATUS_SUCCESS) {
d_printf("could not obtain winbind separator!\n");
+ if (strict) {
+ return -1;
+ }
/* HACK: (this module should not call lp_ funtions) */
return *lp_winbind_separator();
}
@@ -55,6 +58,9 @@ static char winbind_separator(void)
if (!sep) {
d_printf("winbind separator was NULL!\n");
+ if (strict) {
+ return -1;
+ }
/* HACK: (this module should not call lp_ funtions) */
sep = *lp_winbind_separator();
}
@@ -62,6 +68,11 @@ static char winbind_separator(void)
return sep;
}
+static char winbind_separator(void)
+{
+ return winbind_separator_int(False);
+}
+
static const char *get_winbind_domain(void)
{
struct winbindd_response response;
@@ -956,7 +967,8 @@ enum {
OPT_SEQUENCE,
OPT_GETDCNAME,
OPT_USERDOMGROUPS,
- OPT_USERSIDS
+ OPT_USERSIDS,
+ OPT_SEPARATOR
};
int main(int argc, char **argv)
@@ -1004,6 +1016,7 @@ int main(int argc, char **argv)
#ifdef WITH_FAKE_KASERVER
{ "klog", 'k', POPT_ARG_STRING, &string_arg, 'k', "set an AFS token from winbind", "user%password" },
#endif
+ { "separator", 0, POPT_ARG_NONE, 0, OPT_SEPARATOR, "Get the active winbind separator", NULL },
POPT_COMMON_VERSION
POPT_TABLEEND
};
@@ -1197,6 +1210,10 @@ int main(int argc, char **argv)
case OPT_GETDCNAME:
wbinfo_getdcname(string_arg);
break;
+ case OPT_SEPARATOR:
+ d_printf("%c\n", winbind_separator_int(True));
+ break;
+
/* generic configuration options */
case OPT_DOMAIN_NAME:
break;