summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-08-19 03:11:17 +0000
committerGerald Carter <jerry@samba.org>2004-08-19 03:11:17 +0000
commit728d44296a683e1d3ddc819a781a603f4dde9825 (patch)
treea011c25a090b7817b670304f2d9d01780c6bf932
parentfd1468b85e17b46c9ec4402ef37f4683a045a97f (diff)
downloadsamba-728d44296a683e1d3ddc819a781a603f4dde9825.tar.gz
r1899: this is 3.0.6 -- will release tomorrow
-rw-r--r--WHATSNEW.txt23
-rw-r--r--source/Makefile.in14
-rw-r--r--source/include/messages.h13
-rw-r--r--source/lib/messages.c6
-rw-r--r--source/passdb/passdb.c83
-rw-r--r--source/passdb/pdb_smbpasswd.c6
-rw-r--r--source/printing/nt_printing.c33
-rw-r--r--source/printing/printing.c2
-rw-r--r--source/rpc_server/srv_spoolss_nt.c26
-rw-r--r--source/smbd/connection.c1
-rw-r--r--source/smbd/reply.c2
-rw-r--r--source/smbd/server.c2
-rw-r--r--source/smbd/vfs.c8
13 files changed, 149 insertions, 70 deletions
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 24622d1ce94..45f47c12c30 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -107,19 +107,32 @@ o Jeremy Allison <jra@samba.org>
* BUG 1606: Force smbd to disable sendfile with DOS clients
and ensure that the chained header is filled in for ...&X
commands.
+ * BUG 1602: Fix access to shares when all symlink support
+ has been disabled.
+
+
+o Gerald (Jerry) Carter <jerry@samba.org>
+ * Tighten the cache consistency with the ntprinters.tdb entry
+ an the in memory cache associated with open printer handles.
+ * Make sure that register_messages_flags() doesn't overwrite
+ the originally registers flags.
o Steve French <sfrench@us.ibm.com>
- o prevent infinite recusion in reopen_logs() when expanding
+ * prevent infinite recusion in reopen_logs() when expanding
the smb.conf variable %I.
+o Luke Howard <lukeh@padl.com>
+ * Correctly use uid_to_sid() and gid_to_sid() in
+ pdb_set_sam_sids().
+
o Volker Lendecke <vl@samba.org>
- o Improved NT->AFS ACL mapping VFS module.
+ * Improved NT->AFS ACL mapping VFS module.
o Lars Mueller <lmuelle@suse.de>
- o Fix compiler warnings in the kerberos client code.
+ * Fix compiler warnings in the kerberos client code.
o James Peach <jpeach@sgi.com>
@@ -129,6 +142,10 @@ o James Peach <jpeach@sgi.com>
in a directory.
+o Jelmer Vernooij <jelmer@samba.org>
+ * BUG 1474: Fix build of --with-expsma stuff on Solaris.
+
+
Changes since 3.0.5
-------------------
diff --git a/source/Makefile.in b/source/Makefile.in
index 58c8a7895d6..0fa46f6f9e0 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -34,6 +34,9 @@ PASSDB_LIBS=@PASSDB_LIBS@
IDMAP_LIBS=@IDMAP_LIBS@
KRB5LIBS=@KRB5_LIBS@
LDAP_LIBS=@LDAP_LIBS@
+XML_LIBS=@XML_LIBS@
+MYSQL_LIBS=@MYSQL_LIBS@
+PGSQL_LIBS=@PGSQL_LIBS@
LINK=$(CC) $(FLAGS) $(LDFLAGS)
@@ -533,7 +536,7 @@ NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_ads_cldap.o utils/net_help.o \
utils/net_rap.o utils/net_rpc.o utils/net_rpc_samsync.o \
utils/net_rpc_join.o utils/net_time.o utils/net_lookup.o \
utils/net_cache.o utils/net_groupmap.o utils/net_idmap.o \
- utils/net_status.o
+ utils/net_status.o
NET_OBJ = $(NET_OBJ1) $(PARAM_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) \
$(RPC_PARSE_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
@@ -835,7 +838,8 @@ bin/rpcclient@EXEEXT@: $(RPCCLIENT_OBJ) @BUILD_POPT@ bin/.dummy
@echo Linking $@
@$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(PASSDB_LIBS) $(RPCCLIENT_OBJ) \
$(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ \
- $(KRB5LIBS) $(LDAP_LIBS)
+ $(KRB5LIBS) $(LDAP_LIBS) \
+ $(XML_LIBS) $(MYSQL_LIBS) $(PGSQL_LIBS)
bin/smbclient@EXEEXT@: $(CLIENT_OBJ) @BUILD_POPT@ bin/.dummy
@echo Linking $@
@@ -1115,12 +1119,12 @@ bin/sam.@SHLIBEXT@: $(AUTH_SAM_OBJ:.o=.@PICSUFFIX@)
bin/mysql.@SHLIBEXT@: $(MYSQL_OBJ:.o=.@PICSUFFIX@)
@echo "Building plugin $@"
- @$(SHLD) $(LDSHFLAGS) -o $@ $(MYSQL_OBJ:.o=.@PICSUFFIX@) @MYSQL_LIBS@ \
+ @$(SHLD) $(LDSHFLAGS) -o $@ $(MYSQL_OBJ:.o=.@PICSUFFIX@) $(MYSQL_LIBS) \
@SONAMEFLAG@`basename $@`
bin/pgsql.@SHLIBEXT@: $(PGSQL_OBJ:.o=.@PICSUFFIX@)
@echo "Building plugin $@"
- @$(SHLD) $(LDSHFLAGS) -o $@ $(PGSQL_OBJ:.o=.@PICSUFFIX@) @PGSQL_LIBS@ \
+ @$(SHLD) $(LDSHFLAGS) -o $@ $(PGSQL_OBJ:.o=.@PICSUFFIX@) $(PGSQL_LIBS) \
@SONAMEFLAG@`basename $@`
bin/ldapsam.@SHLIBEXT@: passdb/pdb_ldap.@PICSUFFIX@
@@ -1160,7 +1164,7 @@ bin/macosxfs.@SHLIBEXT@: $(CHARSET_MACOSXFS_OBJ:.o=.@PICSUFFIX@)
bin/xml.@SHLIBEXT@: $(XML_OBJ:.o=.@PICSUFFIX@)
@echo "Building plugin $@"
- @$(SHLD) $(LDSHFLAGS) -o $@ $(XML_OBJ:.o=.@PICSUFFIX@) @XML_LIBS@ \
+ @$(SHLD) $(LDSHFLAGS) -o $@ $(XML_OBJ:.o=.@PICSUFFIX@) $(XML_LIBS) \
@SONAMEFLAG@`basename $@`
bin/audit.@SHLIBEXT@: $(VFS_AUDIT_OBJ:.o=.@PICSUFFIX@)
diff --git a/source/include/messages.h b/source/include/messages.h
index 78f19fa0bdb..a87659f4984 100644
--- a/source/include/messages.h
+++ b/source/include/messages.h
@@ -49,10 +49,12 @@
/* printing messages */
/* #define MSG_PRINTER_NOTIFY 2001*/ /* Obsolete */
-#define MSG_PRINTER_DRVUPGRADE 2002
-#define MSG_PRINTER_NOTIFY2 2003
-#define MSG_PRINTERDATA_INIT_RESET 2004
-#define MSG_PRINTER_UPDATE 2005
+#define MSG_PRINTER_NOTIFY2 2002
+
+#define MSG_PRINTER_DRVUPGRADE 2101
+#define MSG_PRINTERDATA_INIT_RESET 2102
+#define MSG_PRINTER_UPDATE 2103
+#define MSG_PRINTER_MOD 2104
/* smbd messages */
#define MSG_SMB_CONF_UPDATED 3001
@@ -67,6 +69,7 @@
#define FLAG_MSG_GENERAL 0x0001
#define FLAG_MSG_SMBD 0x0002
#define FLAG_MSG_NMBD 0x0004
-#define FLAG_MSG_PRINTING 0x0008
+#define FLAG_MSG_PRINT_NOTIFY 0x0008
+#define FLAG_MSG_PRINT_GENERAL 0x0010
#endif
diff --git a/source/lib/messages.c b/source/lib/messages.c
index 8706ede7065..ded3ac95bb4 100644
--- a/source/lib/messages.c
+++ b/source/lib/messages.c
@@ -576,8 +576,10 @@ BOOL message_send_all(TDB_CONTEXT *conn_tdb, int msg_type,
msg_all.msg_flag = FLAG_MSG_GENERAL;
else if (msg_type > 1000 && msg_type < 2000)
msg_all.msg_flag = FLAG_MSG_NMBD;
- else if (msg_type > 2000 && msg_type < 3000)
- msg_all.msg_flag = FLAG_MSG_PRINTING;
+ else if (msg_type > 2000 && msg_type < 2100)
+ msg_all.msg_flag = FLAG_MSG_PRINT_NOTIFY;
+ else if (msg_type > 2100 && msg_type < 3000)
+ msg_all.msg_flag = FLAG_MSG_PRINT_GENERAL;
else if (msg_type > 3000 && msg_type < 4000)
msg_all.msg_flag = FLAG_MSG_SMBD;
else
diff --git a/source/passdb/passdb.c b/source/passdb/passdb.c
index 0905d816920..14c8c67aa3c 100644
--- a/source/passdb/passdb.c
+++ b/source/passdb/passdb.c
@@ -190,7 +190,9 @@ static NTSTATUS pdb_set_sam_sids(SAM_ACCOUNT *account_data, const struct passwd
const char *guest_account = lp_guestaccount();
GROUP_MAP map;
BOOL ret;
-
+ DOM_SID user_sid;
+ DOM_SID group_sid;
+
if (!account_data || !pwd) {
return NT_STATUS_INVALID_PARAMETER;
}
@@ -198,7 +200,7 @@ static NTSTATUS pdb_set_sam_sids(SAM_ACCOUNT *account_data, const struct passwd
/* this is a hack this thing should not be set
this way --SSS */
if (!(guest_account && *guest_account)) {
- DEBUG(1, ("NULL guest account!?!?\n"));
+ DEBUG(1, ("pdb_set_sam_sids: NULL guest account!?!?\n"));
return NT_STATUS_UNSUCCESSFUL;
} else {
/* Ensure this *must* be set right */
@@ -213,8 +215,13 @@ static NTSTATUS pdb_set_sam_sids(SAM_ACCOUNT *account_data, const struct passwd
}
}
- if (!pdb_set_user_sid_from_rid(account_data, fallback_pdb_uid_to_user_rid(pwd->pw_uid), PDB_SET)) {
- DEBUG(0,("Can't set User SID from RID!\n"));
+ if (NT_STATUS_IS_OK(uid_to_sid(&user_sid, pwd->pw_uid))) {
+ if (!pdb_set_user_sid(account_data, &user_sid, PDB_SET)) {
+ DEBUG(0,("pdb_set_sam_sids: Can't set User SID from mapped UID\n"));
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+ } else if (!pdb_set_user_sid_from_rid(account_data, algorithmic_pdb_uid_to_user_rid(pwd->pw_uid), PDB_SET)) {
+ DEBUG(0,("pdb_set_sam_sids: Can't set User SID from RID!\n"));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -225,13 +232,18 @@ static NTSTATUS pdb_set_sam_sids(SAM_ACCOUNT *account_data, const struct passwd
if( ret ) {
if (!pdb_set_group_sid(account_data, &map.sid, PDB_SET)){
- DEBUG(0,("Can't set Group SID!\n"));
+ DEBUG(0,("pdb_set_sam_sids: Can't set Group SID!\n"));
return NT_STATUS_INVALID_PARAMETER;
}
}
else {
- if (!pdb_set_group_sid_from_rid(account_data, pdb_gid_to_group_rid(pwd->pw_gid), PDB_SET)) {
- DEBUG(0,("Can't set Group SID\n"));
+ if (NT_STATUS_IS_OK(gid_to_sid(&group_sid, pwd->pw_gid))) {
+ if (!pdb_set_group_sid(account_data, &group_sid, PDB_SET)) {
+ DEBUG(0,("pdb_set_sam_sids: Can't set Group SID from mapped GID\n"));
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+ } else if (!pdb_set_group_sid_from_rid(account_data, pdb_gid_to_group_rid(pwd->pw_gid), PDB_SET)) {
+ DEBUG(0,("pdb_set_sam_sids: Can't set Group SID\n"));
return NT_STATUS_INVALID_PARAMETER;
}
}
@@ -370,7 +382,7 @@ NTSTATUS pdb_init_sam_new(SAM_ACCOUNT **new_sam_acct, const char *username,
/* see if we need to generate a new rid using the 2.2 algorithm */
if ( rid == 0 && lp_enable_rid_algorithm() ) {
DEBUG(10,("pdb_init_sam_new: no RID specified. Generating one via old algorithm\n"));
- rid = fallback_pdb_uid_to_user_rid(pwd->pw_uid);
+ rid = algorithmic_pdb_uid_to_user_rid(pwd->pw_uid);
}
/* set the new SID */
@@ -660,7 +672,7 @@ int algorithmic_rid_base(void)
Converts NT user RID to a UNIX uid.
********************************************************************/
-uid_t fallback_pdb_user_rid_to_uid(uint32 user_rid)
+uid_t algorithmic_pdb_user_rid_to_uid(uint32 user_rid)
{
int rid_offset = algorithmic_rid_base();
return (uid_t)(((user_rid & (~USER_RID_TYPE)) - rid_offset)/RID_MULTIPLIER);
@@ -670,7 +682,7 @@ uid_t fallback_pdb_user_rid_to_uid(uint32 user_rid)
converts UNIX uid to an NT User RID.
********************************************************************/
-uint32 fallback_pdb_uid_to_user_rid(uid_t uid)
+uint32 algorithmic_pdb_uid_to_user_rid(uid_t uid)
{
int rid_offset = algorithmic_rid_base();
return (((((uint32)uid)*RID_MULTIPLIER) + rid_offset) | USER_RID_TYPE);
@@ -716,26 +728,19 @@ static BOOL pdb_rid_is_well_known(uint32 rid)
Decides if a RID is a user or group RID.
********************************************************************/
-BOOL fallback_pdb_rid_is_user(uint32 rid)
+BOOL algorithmic_pdb_rid_is_user(uint32 rid)
{
- /* lkcl i understand that NT attaches an enumeration to a RID
- * such that it can be identified as either a user, group etc
- * type. there are 5 such categories, and they are documented.
- */
- /* However, they are not in the RID, just somthing you can query
- seperatly. Sorry luke :-) */
-
- if(pdb_rid_is_well_known(rid)) {
- /*
- * The only well known user RIDs are DOMAIN_USER_RID_ADMIN
- * and DOMAIN_USER_RID_GUEST.
- */
- if(rid == DOMAIN_USER_RID_ADMIN || rid == DOMAIN_USER_RID_GUEST)
- return True;
- } else if((rid & RID_TYPE_MASK) == USER_RID_TYPE) {
- return True;
- }
- return False;
+ if(pdb_rid_is_well_known(rid)) {
+ /*
+ * The only well known user RIDs are DOMAIN_USER_RID_ADMIN
+ * and DOMAIN_USER_RID_GUEST.
+ */
+ if(rid == DOMAIN_USER_RID_ADMIN || rid == DOMAIN_USER_RID_GUEST)
+ return True;
+ } else if((rid & RID_TYPE_MASK) == USER_RID_TYPE) {
+ return True;
+ }
+ return False;
}
/*******************************************************************
@@ -806,13 +811,13 @@ BOOL local_lookup_sid(const DOM_SID *sid, char *name, enum SID_NAME_USE *psid_na
return True;
}
- if (fallback_pdb_rid_is_user(rid)) {
+ if (algorithmic_pdb_rid_is_user(rid)) {
uid_t uid;
struct passwd *pw = NULL;
DEBUG(5, ("assuming RID %u is a user\n", (unsigned)rid));
- uid = fallback_pdb_user_rid_to_uid(rid);
+ uid = algorithmic_pdb_user_rid_to_uid(rid);
pw = sys_getpwuid( uid );
DEBUG(5,("local_lookup_sid: looking up uid %u %s\n", (unsigned int)uid,
@@ -851,7 +856,7 @@ BOOL local_lookup_sid(const DOM_SID *sid, char *name, enum SID_NAME_USE *psid_na
DEBUG(5,("local_lookup_sid: found group %s for rid %u\n", name,
(unsigned int)rid ));
- /* assume fallback groups aer domain global groups */
+ /* assume algorithmic groups are domain global groups */
*psid_name_use = SID_NAME_DOM_GRP;
@@ -1119,7 +1124,7 @@ DOM_SID *algorithmic_uid_to_sid(DOM_SID *psid, uid_t uid)
DEBUG(8,("algorithmic_uid_to_sid: falling back to RID algorithm\n"));
sid_copy( psid, get_global_sam_sid() );
- sid_append_rid( psid, fallback_pdb_uid_to_user_rid(uid) );
+ sid_append_rid( psid, algorithmic_pdb_uid_to_user_rid(uid) );
DEBUG(10,("algorithmic_uid_to_sid: uid (%d) -> SID %s.\n",
(unsigned int)uid, sid_string_static(psid) ));
@@ -1263,7 +1268,7 @@ DOM_SID *local_gid_to_sid(DOM_SID *psid, gid_t gid)
if ( !ret ) {
- /* fallback to rid mapping if enabled */
+ /* algorithmic to rid mapping if enabled */
if ( lp_enable_rid_algorithm() ) {
@@ -1308,7 +1313,7 @@ BOOL local_sid_to_gid(gid_t *pgid, const DOM_SID *psid, enum SID_NAME_USE *name_
if ( !ret ) {
- /* fallback to rid mapping if enabled */
+ /* Fallback to algorithmic rid mapping if enabled */
if ( lp_enable_rid_algorithm() ) {
@@ -1324,7 +1329,7 @@ BOOL local_sid_to_gid(gid_t *pgid, const DOM_SID *psid, enum SID_NAME_USE *name_
DEBUG(10,("local_sid_to_gid: Fall back to algorithmic mapping\n"));
- if (fallback_pdb_rid_is_user(rid)) {
+ if (algorithmic_pdb_rid_is_user(rid)) {
DEBUG(3, ("local_sid_to_gid: SID %s is *NOT* a group\n", sid_string_static(psid)));
return False;
} else {
@@ -2257,11 +2262,11 @@ BOOL get_free_rid_range(uint32 *low, uint32 *high)
return False;
}
- *low = fallback_pdb_uid_to_user_rid(id_low);
- if (fallback_pdb_user_rid_to_uid((uint32)-1) < id_high) {
+ *low = algorithmic_pdb_uid_to_user_rid(id_low);
+ if (algorithmic_pdb_user_rid_to_uid((uint32)-1) < id_high) {
*high = (uint32)-1;
} else {
- *high = fallback_pdb_uid_to_user_rid(id_high);
+ *high = algorithmic_pdb_uid_to_user_rid(id_high);
}
return True;
diff --git a/source/passdb/pdb_smbpasswd.c b/source/passdb/pdb_smbpasswd.c
index 562d50f89e3..6ebac1c01a5 100644
--- a/source/passdb/pdb_smbpasswd.c
+++ b/source/passdb/pdb_smbpasswd.c
@@ -1144,8 +1144,8 @@ static BOOL build_smb_pass (struct smb_passwd *smb_pw, const SAM_ACCOUNT *sampas
smb_pw->smb_userid=passwd->pw_uid;
passwd_free(&passwd);
- } else if (fallback_pdb_rid_is_user(rid)) {
- smb_pw->smb_userid=fallback_pdb_user_rid_to_uid(rid);
+ } else if (algorithmic_pdb_rid_is_user(rid)) {
+ smb_pw->smb_userid=algorithmic_pdb_user_rid_to_uid(rid);
} else {
DEBUG(0,("build_sam_pass: Failing attempt to store user with non-uid based user RID. \n"));
return False;
@@ -1366,7 +1366,7 @@ static NTSTATUS smbpasswd_getsampwsid(struct pdb_methods *my_methods, SAM_ACCOUN
return nt_status;
}
- while ( ((smb_pw=getsmbfilepwent(smbpasswd_state, fp)) != NULL) && (fallback_pdb_uid_to_user_rid(smb_pw->smb_userid) != rid) )
+ while ( ((smb_pw=getsmbfilepwent(smbpasswd_state, fp)) != NULL) && (algorithmic_pdb_uid_to_user_rid(smb_pw->smb_userid) != rid) )
/* do nothing */ ;
endsmbfilepwent(fp, &(smbpasswd_state->pw_file_lock_depth));
diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c
index 225ff20ec3e..8c0302b4300 100644
--- a/source/printing/nt_printing.c
+++ b/source/printing/nt_printing.c
@@ -363,6 +363,17 @@ BOOL nt_printing_init(void)
message_register( MSG_PRINTERDATA_INIT_RESET, reset_all_printerdata );
+ /*
+ * register callback to handle invalidating the printer cache
+ * between smbd processes.
+ */
+
+ message_register( MSG_PRINTER_MOD, receive_printer_mod_msg);
+
+ /* of course, none of the message callbacks matter if you don't
+ tell messages.c that you interested in receiving PRINT_GENERAL
+ msgs. This is done in claim_connection() */
+
return True;
}
@@ -3456,6 +3467,27 @@ static uint32 rev_changeid(void)
#endif
}
+/********************************************************************
+ Send a message to all smbds about the printer that just changed
+ ********************************************************************/
+
+static BOOL send_printer_mod_msg( char* printername )
+{
+ int len = strlen(printername);
+
+ if (!len)
+ return False;
+
+ DEBUG(10,("send_printer_mod_msg: Sending message about printer change [%s]\n",
+ printername));
+
+ /* spam everyone that we just changed this printer */
+
+ message_send_all( conn_tdb_ctx(), MSG_PRINTER_MOD, printername, len+1, False, NULL );
+
+ return True;
+}
+
/*
* The function below are the high level ones.
* only those ones must be called from the spoolss code.
@@ -3479,6 +3511,7 @@ WERROR mod_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level)
*/
invalidate_printer_hnd_cache( printer.info_2->sharename );
+ send_printer_mod_msg( printer.info_2->sharename );
switch (level) {
case 2:
diff --git a/source/printing/printing.c b/source/printing/printing.c
index 10ca7e47e71..31cb0faa9b0 100644
--- a/source/printing/printing.c
+++ b/source/printing/printing.c
@@ -1183,7 +1183,7 @@ void start_background_queue(void)
DEBUG(5,("start_background_queue: background LPQ thread started\n"));
claim_connection( NULL, "smbd lpq backend", 0, False,
- FLAG_MSG_GENERAL|FLAG_MSG_SMBD|FLAG_MSG_PRINTING );
+ FLAG_MSG_GENERAL|FLAG_MSG_SMBD|FLAG_MSG_PRINT_GENERAL);
if (!locking_init(0)) {
exit(1);
diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c
index e3c9ff08d93..db60855ba09 100644
--- a/source/rpc_server/srv_spoolss_nt.c
+++ b/source/rpc_server/srv_spoolss_nt.c
@@ -180,7 +180,7 @@ static void srv_spoolss_replycloseprinter(int snum, POLICY_HND *handle)
/* Tell the connections db we're no longer interested in
* printer notify messages. */
- register_message_flags( False, FLAG_MSG_PRINTING );
+ register_message_flags( False, FLAG_MSG_PRINT_NOTIFY );
}
smb_connections--;
@@ -1194,12 +1194,6 @@ static void receive_notify2_message_list(int msg_type, pid_t src, void *msg, siz
notify2_unpack_msg( &notify, &msg_tv, msg_ptr, msg_len );
msg_ptr += msg_len;
- /* we don't know if the change was from us or not so kill
- any cached printer objects */
-
- if ( notify.type == PRINTER_NOTIFY_TYPE )
- invalidate_printer_hnd_cache( notify.printer );
-
/* add to correct list in container */
notify_msg_ctr_addmsg( &messages, &notify );
@@ -1227,6 +1221,22 @@ static void receive_notify2_message_list(int msg_type, pid_t src, void *msg, siz
}
/********************************************************************
+ callback to MSG_PRINTER_CHANGED. When a printer is changed by
+ one smbd, all of processes must clear their printer cache immediately.
+ ********************************************************************/
+
+void receive_printer_mod_msg(int msg_type, pid_t src, void *buf, size_t len)
+{
+ fstring printername;
+
+ fstrcpy( printername, buf );
+
+ DEBUG(10,("receive_printer_mod_msg: Printer change [%s]\n", printername ));
+
+ invalidate_printer_hnd_cache( printername );
+}
+
+/********************************************************************
Send a message to ourself about new driver being installed
so we can upgrade the information for each printer bound to this
driver
@@ -2640,7 +2650,7 @@ static BOOL srv_spoolss_replyopenprinter(int snum, const char *printer,
message_register(MSG_PRINTER_NOTIFY2, receive_notify2_message_list);
/* Tell the connections db we're now interested in printer
* notify messages. */
- register_message_flags( True, FLAG_MSG_PRINTING );
+ register_message_flags( True, FLAG_MSG_PRINT_NOTIFY );
}
/*
diff --git a/source/smbd/connection.c b/source/smbd/connection.c
index 5bb76eb3bd8..fc5fe9d7418 100644
--- a/source/smbd/connection.c
+++ b/source/smbd/connection.c
@@ -222,7 +222,6 @@ BOOL register_message_flags(BOOL doreg, uint32 msg_flags)
}
pcrec = (struct connections_data *)dbuf.dptr;
- pcrec->bcast_msg_flags = msg_flags;
if (doreg)
pcrec->bcast_msg_flags |= msg_flags;
else
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index 74872eeea9f..611fb04c19b 100644
--- a/source/smbd/reply.c
+++ b/source/smbd/reply.c
@@ -242,7 +242,7 @@ int reply_special(char *inbuf,char *outbuf)
reload_services(True);
reopen_logs();
- claim_connection(NULL,"",0,True,FLAG_MSG_GENERAL|FLAG_MSG_SMBD);
+ claim_connection(NULL,"",0,True,FLAG_MSG_GENERAL|FLAG_MSG_SMBD|FLAG_MSG_PRINT_GENERAL);
already_got_session = True;
break;
diff --git a/source/smbd/server.c b/source/smbd/server.c
index 16281dd86cb..0fe633bb969 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -846,6 +846,8 @@ void build_options(BOOL screen);
exit(1);
/* Setup the main smbd so that we can get messages. */
+ /* don't worry about general printing messages here */
+
claim_connection(NULL,"",0,True,FLAG_MSG_GENERAL|FLAG_MSG_SMBD);
/* only start the background queue daemon if we are
diff --git a/source/smbd/vfs.c b/source/smbd/vfs.c
index 13cfdac0f35..a47f040f6a8 100644
--- a/source/smbd/vfs.c
+++ b/source/smbd/vfs.c
@@ -814,7 +814,7 @@ BOOL canonicalize_path(connection_struct *conn, pstring path)
it is below dir in the heirachy. This uses realpath.
********************************************************************/
-BOOL reduce_name(connection_struct *conn, pstring fname)
+BOOL reduce_name(connection_struct *conn, const pstring fname)
{
#ifdef REALPATH_TAKES_NULL
BOOL free_resolved_name = True;
@@ -924,7 +924,11 @@ BOOL reduce_name(connection_struct *conn, pstring fname)
}
if (!*p) {
- pstrcpy(resolved_name, ".");
+ if (fname[0] == '.' && fname[1] == '/' && fname[2] == '\0') {
+ pstrcpy(resolved_name, "./");
+ } else {
+ pstrcpy(resolved_name, ".");
+ }
p = resolved_name;
}