From 3c3e048f45f47282bec168a448fd0d529f54678d Mon Sep 17 00:00:00 2001 From: branch-fixup Date: Sun, 11 Feb 2007 18:39:04 +0000 Subject: [PATCH] Add files from parent branch HEAD: net/samba/patches/patch-af net/samba/patches/patch-aw net/samba/patches/patch-bg net/samba/patches/patch-bm net/samba/patches/patch-bn net/samba/patches/patch-bv --- net/samba/patches/patch-af | 57 ++++++++++++++++++++++++++++++ net/samba/patches/patch-aw | 13 +++++++ net/samba/patches/patch-bg | 49 ++++++++++++++++++++++++++ net/samba/patches/patch-bm | 17 +++++++++ net/samba/patches/patch-bn | 11 ++++++ net/samba/patches/patch-bv | 71 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 218 insertions(+) create mode 100644 net/samba/patches/patch-af create mode 100644 net/samba/patches/patch-aw create mode 100644 net/samba/patches/patch-bg create mode 100644 net/samba/patches/patch-bm create mode 100644 net/samba/patches/patch-bn create mode 100644 net/samba/patches/patch-bv diff --git a/net/samba/patches/patch-af b/net/samba/patches/patch-af new file mode 100644 index 000000000000..8e713b613f48 --- /dev/null +++ b/net/samba/patches/patch-af @@ -0,0 +1,57 @@ +$NetBSD$ + +--- ../examples/smb.conf.default.orig 2007-02-04 18:59:31.000000000 +0000 ++++ ../examples/smb.conf.default 2007-02-11 15:22:45.000000000 +0000 +@@ -26,7 +26,7 @@ + workgroup = MYGROUP + + # server string is the equivalent of the NT Description field +- server string = Samba Server ++ server string = Samba %v (%h) + + # Security mode. Defines in which mode Samba will operate. Possible + # values are share, user, server, domain and ads. Most people will want +@@ -63,10 +63,10 @@ + + # this tells Samba to use a separate log file for each machine + # that connects +- log file = /usr/local/samba/var/log.%m ++; log file = /usr/local/samba/var/log.%m + + # Put a capping on the size of the log files (in Kb). +- max log size = 50 ++; max log size = 50 + + # Use password server option only with security = server + # The argument list may include: +@@ -145,7 +145,7 @@ + + # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names + # via DNS nslookups. The default is NO. +- dns proxy = no ++; dns proxy = no + + # These scripts are used on a domain controller or stand-alone + # machine to add or delete corresponding unix accounts +@@ -182,14 +182,14 @@ + + # NOTE: If you have a BSD-style print system there is no need to + # specifically define each individual printer +-[printers] +- comment = All Printers +- path = /usr/spool/samba +- browseable = no ++;[printers] ++; comment = All Printers ++; path = /var/tmp ++; browseable = no + # Set public = yes to allow user 'guest account' to print +- guest ok = no +- writable = no +- printable = yes ++; guest ok = no ++; writable = no ++; printable = yes + + # This one is useful for people to share files + ;[tmp] diff --git a/net/samba/patches/patch-aw b/net/samba/patches/patch-aw new file mode 100644 index 000000000000..4783c088c9cf --- /dev/null +++ b/net/samba/patches/patch-aw @@ -0,0 +1,13 @@ +$NetBSD$ + +--- script/installmodules.sh.orig 2006-04-20 03:29:42.000000000 +0100 ++++ script/installmodules.sh 2007-02-11 17:24:32.000000000 +0000 +@@ -11,7 +11,7 @@ + + for d in $prefix $LIBDIR; do + if [ ! -d $DESTDIR/$d ]; then +-mkdir $DESTDIR/$d ++mkdir -p $DESTDIR/$d + if [ ! -d $DESTDIR/$d ]; then + echo Failed to make directory $DESTDIR/$d + exit 1 diff --git a/net/samba/patches/patch-bg b/net/samba/patches/patch-bg new file mode 100644 index 000000000000..cab1f2e15b29 --- /dev/null +++ b/net/samba/patches/patch-bg @@ -0,0 +1,49 @@ +$NetBSD$ + +--- printing/nt_printing.c.orig 2007-02-04 19:09:01.000000000 +0000 ++++ printing/nt_printing.c 2007-02-11 17:43:40.000000000 +0000 +@@ -342,8 +342,7 @@ + SEC_DESC *sec, *new_sec; + TALLOC_CTX *ctx = state; + int result, i; +- uint32 sd_size; +- size_t size_new_sec; ++ size_t sd_size, size_new_sec; + DOM_SID sid; + + if (!data.dptr || data.dsize == 0) { +@@ -551,28 +550,28 @@ + + if (tdb_drivers) + tdb_close(tdb_drivers); +- tdb_drivers = tdb_open_log(lock_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); ++ tdb_drivers = tdb_open_log(state_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); + if (!tdb_drivers) { + DEBUG(0,("nt_printing_init: Failed to open nt drivers database %s (%s)\n", +- lock_path("ntdrivers.tdb"), strerror(errno) )); ++ state_path("ntdrivers.tdb"), strerror(errno) )); + return False; + } + + if (tdb_printers) + tdb_close(tdb_printers); +- tdb_printers = tdb_open_log(lock_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); ++ tdb_printers = tdb_open_log(state_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); + if (!tdb_printers) { + DEBUG(0,("nt_printing_init: Failed to open nt printers database %s (%s)\n", +- lock_path("ntprinters.tdb"), strerror(errno) )); ++ state_path("ntprinters.tdb"), strerror(errno) )); + return False; + } + + if (tdb_forms) + tdb_close(tdb_forms); +- tdb_forms = tdb_open_log(lock_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); ++ tdb_forms = tdb_open_log(state_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); + if (!tdb_forms) { + DEBUG(0,("nt_printing_init: Failed to open nt forms database %s (%s)\n", +- lock_path("ntforms.tdb"), strerror(errno) )); ++ state_path("ntforms.tdb"), strerror(errno) )); + return False; + } + diff --git a/net/samba/patches/patch-bm b/net/samba/patches/patch-bm new file mode 100644 index 000000000000..885c3c33d199 --- /dev/null +++ b/net/samba/patches/patch-bm @@ -0,0 +1,17 @@ +$NetBSD$ + +--- dynconfig.c.orig 2007-02-04 18:59:28.000000000 +0000 ++++ dynconfig.c 2007-02-11 17:51:32.000000000 +0000 +@@ -68,5 +68,12 @@ + pstring dyn_LOCKDIR = LOCKDIR; + pstring dyn_PIDDIR = PIDDIR; + ++/** ++ * @brief Directory holding persistent-state files. ++ * ++ * Not writable, but used to set a default in the parameter table. ++ **/ ++pstring dyn_STATEDIR = STATEDIR; ++ + pstring dyn_SMB_PASSWD_FILE = SMB_PASSWD_FILE; + pstring dyn_PRIVATE_DIR = PRIVATE_DIR; diff --git a/net/samba/patches/patch-bn b/net/samba/patches/patch-bn new file mode 100644 index 000000000000..78f57dcd713f --- /dev/null +++ b/net/samba/patches/patch-bn @@ -0,0 +1,11 @@ +$NetBSD$ + +--- include/dynconfig.h.orig 2007-02-04 18:59:23.000000000 +0000 ++++ include/dynconfig.h 2007-02-11 17:52:33.000000000 +0000 +@@ -34,5 +34,6 @@ + extern fstring dyn_SHLIBEXT; + extern pstring dyn_LOCKDIR; + extern pstring dyn_PIDDIR; ++extern pstring dyn_STATEDIR; + extern pstring dyn_SMB_PASSWD_FILE; + extern pstring dyn_PRIVATE_DIR; diff --git a/net/samba/patches/patch-bv b/net/samba/patches/patch-bv new file mode 100644 index 000000000000..440f2634db1e --- /dev/null +++ b/net/samba/patches/patch-bv @@ -0,0 +1,71 @@ +$NetBSD$ + +--- lib/util_pw.c.orig 2006-04-20 03:29:23.000000000 +0100 ++++ lib/util_pw.c 2007-02-11 17:57:22.000000000 +0000 +@@ -4,6 +4,7 @@ + Safe versions of getpw* calls + + Copyright (C) Andrew Bartlett 2002 ++ Copyright (C) Luke Mewburn 2004 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by +@@ -25,6 +26,7 @@ + struct passwd *tcopy_passwd(TALLOC_CTX *mem_ctx, const struct passwd *from) + { + struct passwd *ret = TALLOC_P(mem_ctx, struct passwd); ++ char *gecos; + if (!ret) { + return NULL; + } +@@ -32,7 +34,10 @@ + ret->pw_passwd = talloc_strdup(ret, from->pw_passwd); + ret->pw_uid = from->pw_uid; + ret->pw_gid = from->pw_gid; +- ret->pw_gecos = talloc_strdup(ret, from->pw_gecos); ++ gecos = (from->pw_gecos != NULL) ? passwd_expand_gecos(from) : NULL; ++ ret->pw_gecos = talloc_strdup(ret, gecos); ++ if (gecos != NULL) ++ SAFE_FREE(gecos); + ret->pw_dir = talloc_strdup(ret, from->pw_dir); + ret->pw_shell = talloc_strdup(ret, from->pw_shell); + return ret; +@@ -126,3 +131,38 @@ + + return tcopy_passwd(mem_ctx, temp); + } ++ ++ ++/**************************************************************** ++ Expand any `&' characters in pw_gecos with a capitalized pw_name. ++****************************************************************/ ++ ++char *passwd_expand_gecos(const struct passwd *pw) ++{ ++ char *p, *bp, *buf; ++ size_t ac, buflen; ++ ++ if (!lp_passwd_expand_gecos()) { ++ return smb_xstrdup(pw->pw_gecos); ++ } ++ ++ ac = 0; ++ /* count number of `&' in pw_gecos */ ++ for (p = pw->pw_gecos; *p; p++) { ++ if (*p == '&') ++ ac++; ++ } ++ buflen = strlen(pw->pw_gecos) + (ac * (strlen(pw->pw_name) - 1)) + 1; ++ buf = smb_xmalloc_array(sizeof(char), buflen); ++ bp = buf; ++ for (p = pw->pw_gecos; *p; p++) { ++ if (*p == '&') { /* replace & with capitalized pw_name */ ++ ac = snprintf(bp, buflen - (bp - buf), ++ "%s", pw->pw_name); ++ *bp = toupper((unsigned char)*bp); ++ bp += ac; ++ } else ++ *bp++ = *p; ++ } ++ return buf; ++} -- 2.41.0