[SCM] Samba Shared Repository - branch master updated
Matthieu Patou
mat at samba.org
Fri Feb 3 03:10:03 MST 2012
The branch, master has been updated
via 357631b s3-nmbd: don't discard DGRAM frames from local addresses when we are a DC
via 9b43ad4 s3-pid: Catch with pid filename's change when config file is not smb.conf
from db869c5 selftest: Fix the exit code of make test when run in buildfarm
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 357631b8b9da95c5cd43e05e8ad9d7ef43fb67da
Author: Matthieu Patou <mat at matws.net>
Date: Fri Jan 27 16:12:52 2012 -0800
s3-nmbd: don't discard DGRAM frames from local addresses when we are a DC
Winbind use netbios to locate the DC, if samba is also a DC then nmbd
receive request from Winbind that are from a local address, those
requests must not be discarded otherwise winbind can't find the DC and
won't try another method.
Autobuild-User: Matthieu Patou <mat at samba.org>
Autobuild-Date: Fri Feb 3 11:09:29 CET 2012 on sn-devel-104
commit 9b43ad4fcac1eb6796973336c5614b18a054080d
Author: Matthieu Patou <mat at matws.net>
Date: Tue Jan 24 21:29:11 2012 -0800
s3-pid: Catch with pid filename's change when config file is not smb.conf
This is what is done in pidfile_create
-----------------------------------------------------------------------
Summary of changes:
source3/lib/pidfile.c | 26 +++++++++++++++++++++++++-
source3/nmbd/nmbd_packets.c | 32 +++++++++++++++++---------------
2 files changed, 42 insertions(+), 16 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/lib/pidfile.c b/source3/lib/pidfile.c
index 88d0fb0..06fca91 100644
--- a/source3/lib/pidfile.c
+++ b/source3/lib/pidfile.c
@@ -30,18 +30,42 @@ static char *pidFile_name = NULL;
/* return the pid in a pidfile. return 0 if the process (or pidfile)
does not exist */
-pid_t pidfile_pid(const char *name)
+pid_t pidfile_pid(const char *program_name)
{
int fd;
char pidstr[20];
pid_t pid;
unsigned int ret;
+ char *name;
+ const char *short_configfile;
char * pidFile;
+ /* Add a suffix to the program name if this is a process with a
+ * none default configuration file name. */
+ if (strcmp( CONFIGFILE, get_dyn_CONFIGFILE()) == 0) {
+ name = SMB_STRDUP(program_name);
+ } else {
+ short_configfile = strrchr( get_dyn_CONFIGFILE(), '/');
+ if (short_configfile == NULL) {
+ /* conf file in current directory */
+ short_configfile = get_dyn_CONFIGFILE();
+ } else {
+ /* full/relative path provided */
+ short_configfile++;
+ }
+ if (asprintf(&name, "%s-%s", program_name,
+ short_configfile) == -1) {
+ smb_panic("asprintf failed");
+ }
+ }
+
if (asprintf(&pidFile, "%s/%s.pid", lp_piddir(), name) == -1) {
+ SAFE_FREE(name);
return 0;
}
+ SAFE_FREE(name);
+
fd = sys_open(pidFile, O_NONBLOCK | O_RDONLY, 0644);
if (fd == -1) {
SAFE_FREE(pidFile);
diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c
index da38dcf..edac6f6 100644
--- a/source3/nmbd/nmbd_packets.c
+++ b/source3/nmbd/nmbd_packets.c
@@ -1995,21 +1995,23 @@ bool listen_for_packets(struct messaging_context *msg, bool run_election)
continue;
}
- if ((is_loopback_ip_v4(packet->ip) || ismyip_v4(packet->ip)) &&
- packet->port == client_port)
- {
- if (client_port == DGRAM_PORT) {
- DEBUG(7,("discarding own dgram packet from %s:%d\n",
- inet_ntoa(packet->ip),packet->port));
- free_packet(packet);
- continue;
- }
-
- if (packet->packet.nmb.header.nm_flags.bcast) {
- DEBUG(7,("discarding own nmb bcast packet from %s:%d\n",
- inet_ntoa(packet->ip),packet->port));
- free_packet(packet);
- continue;
+ if (!IS_DC) {
+ if ((is_loopback_ip_v4(packet->ip) || ismyip_v4(packet->ip)) &&
+ packet->port == client_port)
+ {
+ if (client_port == DGRAM_PORT) {
+ DEBUG(7,("discarding own dgram packet from %s:%d\n",
+ inet_ntoa(packet->ip),packet->port));
+ free_packet(packet);
+ continue;
+ }
+
+ if (packet->packet.nmb.header.nm_flags.bcast) {
+ DEBUG(7,("discarding own nmb bcast packet from %s:%d\n",
+ inet_ntoa(packet->ip),packet->port));
+ free_packet(packet);
+ continue;
+ }
}
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list