s3-passdb: move get_logon_hours_from_pdb() into samr server.
authorGünther Deschner <gd@samba.org>
Tue, 18 May 2010 16:54:56 +0000 (18:54 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 18 May 2010 19:43:05 +0000 (21:43 +0200)
Guenther

source3/include/proto.h
source3/passdb/passdb.c
source3/rpc_server/srv_samr_nt.c

index 6072f07fe9fd34fb116d48cbf2db1062979559c0..154efeb43b042a84ade2bdca67a3bc153989c5bc 100644 (file)
@@ -4387,8 +4387,7 @@ bool get_trust_pw_clear(const char *domain, char **ret_pwd,
 bool get_trust_pw_hash(const char *domain, uint8 ret_pwd[16],
                       const char **account_name,
                       enum netr_SchannelType *channel);
-struct samr_LogonHours get_logon_hours_from_pdb(TALLOC_CTX *mem_ctx,
-                                               struct samu *pw);
+
 /* The following definitions come from passdb/pdb_compat.c  */
 
 uint32 pdb_get_user_rid (const struct samu *sampass);
index 9514e052546f396dfc6227a01d149ff9c85c9f2a..08488f13c975529cee5e6d72dc8b32e73f06080e 100644 (file)
@@ -2397,26 +2397,3 @@ bool get_trust_pw_hash(const char *domain, uint8 ret_pwd[16],
                "password for domain %s\n", domain));
        return False;
 }
-
-struct samr_LogonHours get_logon_hours_from_pdb(TALLOC_CTX *mem_ctx,
-                                               struct samu *pw)
-{
-       struct samr_LogonHours hours;
-       const int units_per_week = 168;
-
-       ZERO_STRUCT(hours);
-       hours.bits = talloc_array(mem_ctx, uint8_t, units_per_week);
-       if (!hours.bits) {
-               return hours;
-       }
-
-       hours.units_per_week = units_per_week;
-       memset(hours.bits, 0xFF, units_per_week);
-
-       if (pdb_get_hours(pw)) {
-               memcpy(hours.bits, pdb_get_hours(pw),
-                      MIN(pdb_get_hours_len(pw), units_per_week));
-       }
-
-       return hours;
-}
index 1dd0088f9ccf8de15b4aa36cf6abee7445b24dfb..b5200af8197dd9f9ab25e7084b542fbfe673b183 100644 (file)
@@ -2399,6 +2399,32 @@ static NTSTATUS init_samr_parameters_string(TALLOC_CTX *mem_ctx,
        return NT_STATUS_OK;
 }
 
+/*************************************************************************
+ *************************************************************************/
+
+static struct samr_LogonHours get_logon_hours_from_pdb(TALLOC_CTX *mem_ctx,
+                                                      struct samu *pw)
+{
+       struct samr_LogonHours hours;
+       const int units_per_week = 168;
+
+       ZERO_STRUCT(hours);
+       hours.bits = talloc_array(mem_ctx, uint8_t, units_per_week);
+       if (!hours.bits) {
+               return hours;
+       }
+
+       hours.units_per_week = units_per_week;
+       memset(hours.bits, 0xFF, units_per_week);
+
+       if (pdb_get_hours(pw)) {
+               memcpy(hours.bits, pdb_get_hours(pw),
+                      MIN(pdb_get_hours_len(pw), units_per_week));
+       }
+
+       return hours;
+}
+
 /*************************************************************************
  get_user_info_1.
  *************************************************************************/