[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Sun Nov 20 05:24:04 UTC 2016


The branch, master has been updated
       via  df9e7c7 lib: Remove global xfile.h includes
       via  c06b78d lib: Move x_fgets_slash to xfile.c
       via  8742d23 lib: Apply an overflow check
       via  3a8bf02 lib: Reformat x_fgets_slash
       via  1314db0 lib: Rename fgets_slash to x_fgets_slash
       via  cd9d957 s3:spoolss: Improve debug messages in construct_printer_driver
       via  f5154f2 s3:spoolss: Return error when there is no driver assigned
       via  e95012b s4-torture: add test to compare PRINTER_INFO_STRESS version and OSVersion
       via  17bc142 s3-spoolss: set the defaults for os_version defines globally.
       via  3fa5884 s3-spoolss: also set new os_major,minor,build values in printer info 0
       via  b9d73fb s3:spoolss: Set default OS Version to Windows Server 2003 R2 SP2
      from  a0783e8 s3/smbd: fix the last resort check that sets the file type attribute

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit df9e7c7ae55da5df1f55be194dff86896897de4a
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Nov 16 17:17:25 2016 +0000

    lib: Remove global xfile.h includes
    
    This makes it more obvious where this legacy code is used
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Sun Nov 20 06:23:19 CET 2016 on sn-devel-144

commit c06b78d0be5066c7e56c7715798f5a7b0b676451
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Nov 16 16:54:38 2016 +0000

    lib: Move x_fgets_slash to xfile.c
    
    This makes it easier to remove the global #include xfile.h
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 8742d239b2ee0d4dd3219c140081f722644044ae
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Nov 16 15:53:45 2016 +0000

    lib: Apply an overflow check
    
    Very unlikely here, as the realloc will have failed long before, but
    still I would like to check overflow.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 3a8bf0222ac163ddda07130ca10cbe602404a944
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Nov 16 15:47:08 2016 +0000

    lib: Reformat x_fgets_slash
    
    This is so old code that I'd like to move somewhere else next, but before
    that I'd like to clean it up a bit.
    
    No code change, just indentation changed and some {} added.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 1314db09dde650e651c9079d746c70c9dcd09b35
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Nov 16 15:39:21 2016 +0000

    lib: Rename fgets_slash to x_fgets_slash
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit cd9d957adb579811a9273861033ec9abb9c16678
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Nov 16 15:31:16 2016 +0100

    s3:spoolss: Improve debug messages in construct_printer_driver
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit f5154f2eb735df52d1d18bb7552ff650eb20861b
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Nov 16 15:29:34 2016 +0100

    s3:spoolss: Return error when there is no driver assigned
    
    If you create a new printer in Samba, there is no driver assinged.
    Detect that early and return the right error code.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit e95012b01f0008123bad60bc3ba17412da5308e6
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 18 11:59:05 2016 +0100

    s4-torture: add test to compare PRINTER_INFO_STRESS version and OSVersion
    
    Guenther
    
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 17bc1427f0d032cc47509c2e95ea2d5524fb7f53
Author: Günther Deschner <gd at samba.org>
Date:   Wed Nov 16 19:24:37 2016 +0100

    s3-spoolss: set the defaults for os_version defines globally.
    
    Guenther
    
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 3fa58844d2dc77c845d4df560e870ff994f1c53e
Author: Günther Deschner <gd at samba.org>
Date:   Wed Nov 16 19:17:55 2016 +0100

    s3-spoolss: also set new os_major,minor,build values in printer info 0
    
    Guenther
    
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit b9d73fb4cba0f651b35aa21c5dee4bddf6cf5d89
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Nov 9 13:17:27 2016 +0100

    s3:spoolss: Set default OS Version to Windows Server 2003 R2 SP2
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12416
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/util/samba_util.h                       |  8 ---
 lib/util/util_file.c                        | 80 ------------------------
 lib/util/xfile.c                            | 94 +++++++++++++++++++++++++++++
 lib/util/xfile.h                            |  7 +++
 libcli/nbt/lmhosts.c                        |  2 +-
 libcli/smbreadline/smbreadline.c            |  1 +
 source3/auth/user_util.c                    |  3 +-
 source3/client/client.c                     |  1 +
 source3/include/includes.h                  |  1 -
 source3/lib/popt_common.c                   |  1 +
 source3/modules/vfs_expand_msdfs.c          |  1 +
 source3/nmbd/nmbd.h                         |  1 +
 source3/nmbd/nmbd_synclists.c               |  2 +-
 source3/nmbd/nmbd_winsserver.c              |  2 +-
 source3/printing/print_aix.c                |  3 +-
 source3/printing/print_standard.c           |  4 +-
 source3/rpc_server/spoolss/srv_spoolss_nt.c | 57 +++++++++++++----
 source3/rpc_server/svcctl/srv_svcctl_reg.c  |  1 +
 source3/utils/ntlm_auth.c                   |  1 +
 source3/winbindd/idmap_hash/mapfile.c       |  1 +
 source4/include/includes.h                  |  1 -
 source4/torture/rpc/spoolss.c               | 53 ++++++++++++++++
 source4/utils/ntlm_auth.c                   |  1 +
 23 files changed, 218 insertions(+), 108 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index 416fde8..7863555 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -46,7 +46,6 @@ extern const char *panic_action;
 
 #include "lib/util/time.h"
 #include "lib/util/data_blob.h"
-#include "lib/util/xfile.h"
 #include "lib/util/byteorder.h"
 #include "lib/util/talloc_stack.h"
 
@@ -333,13 +332,6 @@ const char **str_list_make_v3_const(TALLOC_CTX *mem_ctx,
 
 
 /**
-read a line from a file with possible \ continuation chars. 
-Blanks at the start or end of a line are stripped.
-The string will be allocated if s2 is NULL
-**/
-_PUBLIC_ char *fgets_slash(char *s2,int maxlen,XFILE *f);
-
-/**
  * Read one line (data until next newline or eof) and allocate it 
  */
 _PUBLIC_ char *afdgets(int fd, TALLOC_CTX *mem_ctx, size_t hint);
diff --git a/lib/util/util_file.c b/lib/util/util_file.c
index 1ec3582..4948afb 100644
--- a/lib/util/util_file.c
+++ b/lib/util/util_file.c
@@ -27,86 +27,6 @@
 #include "lib/util/debug.h"
 
 /**
- * @file
- * @brief File-related utility functions
- */
-
-/**
-read a line from a file with possible \ continuation chars.
-Blanks at the start or end of a line are stripped.
-The string will be allocated if s2 is NULL
-**/
-_PUBLIC_ char *fgets_slash(char *s2,int maxlen,XFILE *f)
-{
-  char *s=s2;
-  int len = 0;
-  int c;
-  bool start_of_line = true;
-
-  if (x_feof(f))
-    return(NULL);
-
-  if (maxlen <2) return(NULL);
-
-  if (!s2)
-    {
-      maxlen = MIN(maxlen,8);
-      s = (char *)malloc(maxlen);
-    }
-
-  if (!s) return(NULL);
-
-  *s = 0;
-
-  while (len < maxlen-1)
-    {
-      c = x_getc(f);
-      switch (c)
-	{
-	case '\r':
-	  break;
-	case '\n':
-	  while (len > 0 && s[len-1] == ' ')
-	    {
-	      s[--len] = 0;
-	    }
-	  if (len > 0 && s[len-1] == '\\')
-	    {
-	      s[--len] = 0;
-	      start_of_line = true;
-	      break;
-	    }
-	  return(s);
-	case EOF:
-	  if (len <= 0 && !s2)
-	    SAFE_FREE(s);
-	  return(len>0?s:NULL);
-	case ' ':
-	  if (start_of_line)
-	    break;
-	  /* fall through */
-	default:
-	  start_of_line = false;
-	  s[len++] = c;
-	  s[len] = 0;
-	}
-      if (!s2 && len > maxlen-3)
-	{
-	  char *t;
-
-	  maxlen *= 2;
-	  t = realloc_p(s, char, maxlen);
-	  if (!t) {
-	    DEBUG(0,("fgets_slash: failed to expand buffer!\n"));
-	    SAFE_FREE(s);
-	    return(NULL);
-	  } else s = t;
-	}
-    }
-  return(s);
-}
-
-/**
  * Read one line (data until next newline or eof) and allocate it
  */
 _PUBLIC_ char *afdgets(int fd, TALLOC_CTX *mem_ctx, size_t hint)
diff --git a/lib/util/xfile.c b/lib/util/xfile.c
index 62dd121..b22cb98 100644
--- a/lib/util/xfile.c
+++ b/lib/util/xfile.c
@@ -37,6 +37,8 @@
 #include "system/filesys.h"
 #include "memory.h"
 #include "xfile.h"
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
 
 #define XBUFSIZE BUFSIZ
 
@@ -428,3 +430,95 @@ XFILE *x_fdup(const XFILE *f)
 	x_setvbuf(ret, NULL, X_IOFBF, XBUFSIZE);
 	return ret;
 }
+
+/**
+ * @file
+ * @brief File-related utility functions
+ */
+
+/**
+read a line from a file with possible \ continuation chars.
+Blanks at the start or end of a line are stripped.
+The string will be allocated if s2 is NULL
+**/
+char *x_fgets_slash(char *s2,int maxlen,XFILE *f)
+{
+	char *s=s2;
+	int len = 0;
+	int c;
+	bool start_of_line = true;
+
+	if (x_feof(f)) {
+		return(NULL);
+	}
+
+	if (maxlen <2) {
+		return(NULL);
+	}
+
+	if (!s2) {
+		maxlen = MIN(maxlen,8);
+		s = (char *)malloc(maxlen);
+	}
+
+	if (!s) {
+		return(NULL);
+	}
+
+	*s = 0;
+
+	while (len < maxlen-1) {
+		c = x_getc(f);
+		switch (c)
+		{
+		    case '\r':
+			    break;
+		    case '\n':
+			    while (len > 0 && s[len-1] == ' ') {
+				    s[--len] = 0;
+			    }
+			    if (len > 0 && s[len-1] == '\\') {
+				    s[--len] = 0;
+				    start_of_line = true;
+				    break;
+			    }
+			    return(s);
+		    case EOF:
+			    if (len <= 0 && !s2) {
+				    SAFE_FREE(s);
+			    }
+			    return(len>0?s:NULL);
+		    case ' ':
+			    if (start_of_line) {
+				    break;
+			    }
+			    /* fall through */
+		    default:
+			    start_of_line = false;
+			    s[len++] = c;
+			    s[len] = 0;
+		}
+		if (!s2 && len > maxlen-3) {
+			int m;
+			char *t;
+
+			m = maxlen * 2;
+			if (m < maxlen) {
+				DBG_ERR("length overflow");
+				SAFE_FREE(s);
+				return NULL;
+			}
+			maxlen = m;
+
+			t = realloc_p(s, char, maxlen);
+			if (!t) {
+				DBG_ERR("failed to expand buffer!\n");
+				SAFE_FREE(s);
+				return(NULL);
+			}
+
+			s = t;
+		}
+	}
+	return(s);
+}
diff --git a/lib/util/xfile.h b/lib/util/xfile.h
index f52596d..5fb6341 100644
--- a/lib/util/xfile.h
+++ b/lib/util/xfile.h
@@ -104,4 +104,11 @@ off_t x_tseek(XFILE *f, off_t offset, int whence);
 
 XFILE *x_fdup(const XFILE *f);
 
+/**
+read a line from a file with possible \ continuation chars.
+Blanks at the start or end of a line are stripped.
+The string will be allocated if s2 is NULL
+**/
+_PUBLIC_ char *x_fgets_slash(char *s2,int maxlen,XFILE *f);
+
 #endif /* _XFILE_H_ */
diff --git a/libcli/nbt/lmhosts.c b/libcli/nbt/lmhosts.c
index 3e746f0..e68dc08 100644
--- a/libcli/nbt/lmhosts.c
+++ b/libcli/nbt/lmhosts.c
@@ -66,7 +66,7 @@ bool getlmhostsent(TALLOC_CTX *ctx, XFILE *fp, char **pp_name, int *name_type,
 
 		*name_type = -1;
 
-		if (!fgets_slash(line,sizeof(line),fp)) {
+		if (!x_fgets_slash(line,sizeof(line),fp)) {
 			continue;
 		}
 
diff --git a/libcli/smbreadline/smbreadline.c b/libcli/smbreadline/smbreadline.c
index c585554..8be6e48 100644
--- a/libcli/smbreadline/smbreadline.c
+++ b/libcli/smbreadline/smbreadline.c
@@ -24,6 +24,7 @@
 #include "system/select.h"
 #include "system/readline.h"
 #include "libcli/smbreadline/smbreadline.h"
+#include "lib/util/xfile.h"
 
 #undef malloc
 
diff --git a/source3/auth/user_util.c b/source3/auth/user_util.c
index d5c61b2..f3cf499 100644
--- a/source3/auth/user_util.c
+++ b/source3/auth/user_util.c
@@ -22,6 +22,7 @@
 #include "includes.h"
 #include "system/filesys.h"
 #include "auth.h"
+#include "lib/util/xfile.h"
 
 /*******************************************************************
  Map a username from a dos name to a unix name by looking in the username
@@ -361,7 +362,7 @@ bool map_username(TALLOC_CTX *ctx, const char *user_in, char **p_user_out)
 
 	DEBUG(4,("Scanning username map %s\n",mapfile));
 
-	while((s=fgets_slash(buf,sizeof(buf),f))!=NULL) {
+	while((s=x_fgets_slash(buf,sizeof(buf),f))!=NULL) {
 		char *unixname = s;
 		char *dosname = strchr_m(unixname,'=');
 		char **dosuserlist;
diff --git a/source3/client/client.c b/source3/client/client.c
index ded7971..65696f9 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -39,6 +39,7 @@
 #include "libsmb/nmblib.h"
 #include "include/ntioctl.h"
 #include "../libcli/smb/smbXcli_base.h"
+#include "lib/util/xfile.h"
 
 #ifndef REGISTER
 #define REGISTER 0
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 234a564..a436427 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -303,7 +303,6 @@ typedef char fstring[FSTRING_LEN];
 /* Lists, trees, caching, database... */
 #include "../lib/util/samba_util.h"
 #include "../lib/util/util_net.h"
-#include "../lib/util/xfile.h"
 #include "../lib/util/memory.h"
 #include "../lib/util/attr.h"
 #include "../lib/util/tsort.h"
diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c
index 6c1515b..f74543f 100644
--- a/source3/lib/popt_common.c
+++ b/source3/lib/popt_common.c
@@ -24,6 +24,7 @@
 #include "system/filesys.h"
 #include "popt_common.h"
 #include "lib/param/param.h"
+#include "lib/util/xfile.h"
 
 /* Handle command line options:
  *		-d,--debuglevel 
diff --git a/source3/modules/vfs_expand_msdfs.c b/source3/modules/vfs_expand_msdfs.c
index eaf96e0..40c57c2 100644
--- a/source3/modules/vfs_expand_msdfs.c
+++ b/source3/modules/vfs_expand_msdfs.c
@@ -24,6 +24,7 @@
 #include "smbd/globals.h"
 #include "auth.h"
 #include "../lib/tsocket/tsocket.h"
+#include "lib/util/xfile.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_VFS
diff --git a/source3/nmbd/nmbd.h b/source3/nmbd/nmbd.h
index 47940e1..f2086a5 100644
--- a/source3/nmbd/nmbd.h
+++ b/source3/nmbd/nmbd.h
@@ -25,6 +25,7 @@
 #define SYNC_DNS 1
 #endif
 
+#include "lib/util/xfile.h"
 #include "libsmb/nmblib.h"
 #include "nmbd/nmbd_proto.h"
 
diff --git a/source3/nmbd/nmbd_synclists.c b/source3/nmbd/nmbd_synclists.c
index f3e524d..1c2b04d 100644
--- a/source3/nmbd/nmbd_synclists.c
+++ b/source3/nmbd/nmbd_synclists.c
@@ -262,7 +262,7 @@ static void complete_sync(struct sync_record *s)
 	while (!x_feof(f)) {
 		TALLOC_CTX *frame = NULL;
 
-		if (!fgets_slash(line,sizeof(line),f))
+		if (!x_fgets_slash(line,sizeof(line),f))
 			continue;
 
 		ptr = line;
diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c
index cdec10e..cd4ff42 100644
--- a/source3/nmbd/nmbd_winsserver.c
+++ b/source3/nmbd/nmbd_winsserver.c
@@ -655,7 +655,7 @@ bool initialise_wins(void)
 
 		/* Read a line from the wins.dat file. Strips whitespace
 			from the beginning and end of the line.  */
-		if (!fgets_slash(line,sizeof(line),fp)) {
+		if (!x_fgets_slash(line,sizeof(line),fp)) {
 			continue;
 		}
 
diff --git a/source3/printing/print_aix.c b/source3/printing/print_aix.c
index 927a71b..7b5a1e3 100644
--- a/source3/printing/print_aix.c
+++ b/source3/printing/print_aix.c
@@ -27,6 +27,7 @@
 #include "includes.h"
 #include "system/filesys.h"
 #include "printing/pcap.h"
+#include "lib/util/xfile.h"
 
 #ifdef AIX
 bool aix_cache_reload(struct pcap_cache **_pcache)
@@ -52,7 +53,7 @@ bool aix_cache_reload(struct pcap_cache **_pcache)
 
 	iEtat = 0;
 	/* scan qconfig file for searching <printername>:	*/
-	for (;(line = fgets_slash(NULL, 1024, pfile)); free(line)) {
+	for (;(line = x_fgets_slash(NULL, 1024, pfile)); free(line)) {
 		bool ok;
 
 		if (*line == '*' || *line == 0)
diff --git a/source3/printing/print_standard.c b/source3/printing/print_standard.c
index 140ca70..4404aeb 100644
--- a/source3/printing/print_standard.c
+++ b/source3/printing/print_standard.c
@@ -57,6 +57,7 @@
 #include "includes.h"
 #include "system/filesys.h"
 #include "printing/pcap.h"
+#include "lib/util/xfile.h"
 
 /* handle standard printcap - moved from pcap_printer_fn() */
 bool std_pcap_cache_reload(const char *pcap_name, struct pcap_cache **_pcache)
@@ -73,7 +74,8 @@ bool std_pcap_cache_reload(const char *pcap_name, struct pcap_cache **_pcache)
 		return false;
 	}
 
-	for (; (pcap_line = fgets_slash(NULL, 1024, pcap_file)) != NULL; free(pcap_line)) {
+	for (; (pcap_line = x_fgets_slash(NULL, 1024, pcap_file)) != NULL;
+	     free(pcap_line)) {
 		char *name = NULL;
 		char *comment = NULL;
 		char *p, *q;
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index deb87a3..2b28332 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -76,6 +76,10 @@
 #define MAX_OPEN_PRINTER_EXS 50
 #endif
 
+#define GLOBAL_SPOOLSS_OS_MAJOR_DEFAULT 5
+#define GLOBAL_SPOOLSS_OS_MINOR_DEFAULT 2
+#define GLOBAL_SPOOLSS_OS_BUILD_DEFAULT 3790
+
 struct notify_back_channel;
 
 /* structure to store the printer handles */
@@ -2344,13 +2348,22 @@ static WERROR getprinterdata_printer_server(TALLOC_CTX *mem_ctx,
 		enum ndr_err_code ndr_err;
 		struct spoolss_OSVersion os;
 
+		/*
+		 * Set the default OSVersion to:
+		 *
+		 *     Windows Server 2003R2 SP2 (5.2.3790)
+		 *
+		 * used to be Windows 2000 (5.0.2195)
+		 */
 		os.major		= lp_parm_int(GLOBAL_SECTION_SNUM,
-						      "spoolss", "os_major", 5);
-						      /* Windows 2000 == 5.0 */
+						      "spoolss", "os_major",
+						      GLOBAL_SPOOLSS_OS_MAJOR_DEFAULT);
 		os.minor		= lp_parm_int(GLOBAL_SECTION_SNUM,
-						      "spoolss", "os_minor", 0);
+						      "spoolss", "os_minor",
+						      GLOBAL_SPOOLSS_OS_MINOR_DEFAULT);
 		os.build		= lp_parm_int(GLOBAL_SECTION_SNUM,
-						      "spoolss", "os_build", 2195);
+						      "spoolss", "os_build",
+						      GLOBAL_SPOOLSS_OS_BUILD_DEFAULT);
 		os.extra_string		= "";	/* leave extra string empty */
 
 		ndr_err = ndr_push_struct_blob(&blob, mem_ctx, &os,
@@ -3864,6 +3877,7 @@ static WERROR construct_printer_info0(TALLOC_CTX *mem_ctx,
 	struct timeval setuptime;
 	print_status_struct status;
 	WERROR result;
+	int os_major, os_minor, os_build;
 
 	result = create_printername(mem_ctx, servername, info2->printername, &r->printername);
 	if (!W_ERROR_IS_OK(result)) {
@@ -3910,9 +3924,22 @@ static WERROR construct_printer_info0(TALLOC_CTX *mem_ctx,
 	 */
 	r->global_counter		= session_counter->counter;
 	r->total_pages			= 0;
+
 	/* in 2.2 we reported ourselves as 0x0004 and 0x0565 */
-	SSVAL(&r->version, 0, 0x0005); /* NT 5 */
-	SSVAL(&r->version, 2, 0x0893); /* build 2195 */
+	os_major = lp_parm_int(GLOBAL_SECTION_SNUM,
+			       "spoolss", "os_major",
+			       GLOBAL_SPOOLSS_OS_MAJOR_DEFAULT);
+	os_minor = lp_parm_int(GLOBAL_SECTION_SNUM,
+			       "spoolss", "os_minor",
+			       GLOBAL_SPOOLSS_OS_MINOR_DEFAULT);
+	os_build = lp_parm_int(GLOBAL_SECTION_SNUM,
+			       "spoolss", "os_build",
+			       GLOBAL_SPOOLSS_OS_BUILD_DEFAULT);
+
+	SCVAL(&r->version, 0, os_major);
+	SCVAL(&r->version, 1, os_minor);
+	SSVAL(&r->version, 2, os_build);
+
 	r->free_build			= SPOOLSS_RELEASE_BUILD;
 	r->spooling			= 0;
 	r->max_spooling			= 0;
@@ -5668,21 +5695,27 @@ static WERROR construct_printer_driver_info_level(TALLOC_CTX *mem_ctx,
 	result = winreg_get_printer(tmp_ctx, b,
 				    lp_const_servicename(snum),
 				    &pinfo2);
-
-	DEBUG(8,("construct_printer_driver_info_level: status: %s\n",
-		win_errstr(result)));
-


-- 
Samba Shared Repository



More information about the samba-cvs mailing list