s3:winbind: Move fillup_pw_field() as static to wb_fill_pwent.c
authorVolker Lendecke <vl@samba.org>
Sat, 17 Oct 2009 15:00:13 +0000 (17:00 +0200)
committerVolker Lendecke <vl@samba.org>
Sat, 17 Oct 2009 15:13:02 +0000 (17:13 +0200)
source3/winbindd/wb_fill_pwent.c
source3/winbindd/winbindd_proto.h
source3/winbindd/winbindd_user.c

index 4f4819ca23026c870aeb3200ff7e7b52f9bdc831..8998bf991d1a6263994cfad6675b0460fca9b4fd 100644 (file)
@@ -27,6 +27,14 @@ struct wb_fill_pwent_state {
        struct winbindd_pw *pw;
 };
 
+static bool fillup_pw_field(const char *lp_template,
+                           const char *username,
+                           const char *domname,
+                           uid_t uid,
+                           gid_t gid,
+                           const char *in,
+                           fstring out);
+
 static void wb_fill_pwent_sid2uid_done(struct tevent_req *subreq);
 static void wb_fill_pwent_sid2gid_done(struct tevent_req *subreq);
 
@@ -153,3 +161,42 @@ NTSTATUS wb_fill_pwent_recv(struct tevent_req *req)
 {
        return tevent_req_simple_recv_ntstatus(req);
 }
+
+static bool fillup_pw_field(const char *lp_template,
+                           const char *username,
+                           const char *domname,
+                           uid_t uid,
+                           gid_t gid,
+                           const char *in,
+                           fstring out)
+{
+       char *templ;
+
+       if (out == NULL)
+               return False;
+
+       /* The substitution of %U and %D in the 'template
+          homedir' is done by talloc_sub_specified() below.
+          If we have an in string (which means the value has already
+          been set in the nss_info backend), then use that.
+          Otherwise use the template value passed in. */
+
+       if ((in != NULL) && (in[0] != '\0') && (lp_security() == SEC_ADS)) {
+               templ = talloc_sub_specified(talloc_tos(), in,
+                                            username, domname,
+                                            uid, gid);
+       } else {
+               templ = talloc_sub_specified(talloc_tos(), lp_template,
+                                            username, domname,
+                                            uid, gid);
+       }
+
+       if (!templ)
+               return False;
+
+       safe_strcpy(out, templ, sizeof(fstring) - 1);
+       TALLOC_FREE(templ);
+
+       return True;
+
+}
index 21feddf6d650ac121290ac617bf3b0bc65cb3c85..6e232c9db81aa62a3f0ab5618b019ffdde3e12d2 100644 (file)
@@ -545,14 +545,6 @@ enum winbindd_result winbindd_dual_allocate_gid(struct winbindd_domain *domain,
 
 /* The following definitions come from winbindd/winbindd_user.c  */
 
-bool fillup_pw_field(const char *lp_template,
-                           const char *username,
-                           const char *domname,
-                           uid_t uid,
-                           gid_t gid,
-                           const char *in,
-                    fstring out);
-
 enum winbindd_result winbindd_dual_userinfo(struct winbindd_domain *domain,
                                            struct winbindd_cli_state *state);
 void winbindd_getpwnam(struct winbindd_cli_state *state);
index b709f4c2650ccd80d43534baa8fd9f544ca045a7..6afa941b7f5c207f30a6dfd168f83814d755d58f 100644 (file)
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
 
-bool fillup_pw_field(const char *lp_template,
-                           const char *username,
-                           const char *domname,
-                           uid_t uid,
-                           gid_t gid,
-                           const char *in,
-                           fstring out)
-{
-       char *templ;
-
-       if (out == NULL)
-               return False;
-
-       /* The substitution of %U and %D in the 'template
-          homedir' is done by talloc_sub_specified() below.
-          If we have an in string (which means the value has already
-          been set in the nss_info backend), then use that.
-          Otherwise use the template value passed in. */
-
-       if ((in != NULL) && (in[0] != '\0') && (lp_security() == SEC_ADS)) {
-               templ = talloc_sub_specified(talloc_tos(), in,
-                                            username, domname,
-                                            uid, gid);
-       } else {
-               templ = talloc_sub_specified(talloc_tos(), lp_template,
-                                            username, domname,
-                                            uid, gid);
-       }
-
-       if (!templ)
-               return False;
-
-       safe_strcpy(out, templ, sizeof(fstring) - 1);
-       TALLOC_FREE(templ);
-
-       return True;
-
-}
-
 /* Wrapper for domain->methods->query_user, only on the parent->child pipe */
 
 enum winbindd_result winbindd_dual_userinfo(struct winbindd_domain *domain,