r4856: after testing a simple add printer script, i realized that you still have...
authorGerald Carter <jerry@samba.org>
Wed, 19 Jan 2005 21:10:56 +0000 (21:10 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:54:00 +0000 (10:54 -0500)
source/rpc_server/srv_spoolss_nt.c
source/rpc_server/srv_srvsvc_nt.c

index 31e1e4a3bf5a5ba7ede626c2584795084a1b5119..ed7a544d72de9b7b918334aa471a195c03f4c6a0 100644 (file)
@@ -409,21 +409,21 @@ static WERROR delete_printer_handle(pipes_struct *p, POLICY_HND *hnd)
                if ( is_print_op )
                        become_root();
                
-               ret = smbrun(command, NULL);
+               if ( (ret = smbrun(command, NULL)) == 0 ) {
+                       /* Tell everyone we updated smb.conf. */
+                       message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED, NULL, 0, False, NULL);
+               }
                
                if ( is_print_op )
                        unbecome_root();
 
-               /********** BEGIN SePrintOperatorPrivlege BLOCK **********/
+               /********** END SePrintOperatorPrivlege BLOCK **********/
 
                DEBUGADD(10,("returned [%d]\n", ret));
 
                if (ret != 0) 
                        return WERR_BADFID; /* What to return here? */
 
-               /* Tell everyone we updated smb.conf. */
-               message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED, NULL, 0, False, NULL);
-
                /* go ahead and re-read the services immediately */
                reload_services( False );
 
@@ -6034,7 +6034,10 @@ static BOOL add_printer_hook(NT_USER_TOKEN *token, NT_PRINTER_INFO_LEVEL *printe
        if ( is_print_op )
                become_root();
        
-       ret = smbrun(command, &fd);
+       if ( (ret = smbrun(command, &fd)) == 0 ) {
+               /* Tell everyone we updated smb.conf. */
+               message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED, NULL, 0, False, NULL);
+       }
 
        if ( is_print_op )
                unbecome_root();
@@ -6049,9 +6052,6 @@ static BOOL add_printer_hook(NT_USER_TOKEN *token, NT_PRINTER_INFO_LEVEL *printe
                return False;
        }
 
-       /* Tell everyone we updated smb.conf. */
-       message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED, NULL, 0, False, NULL);
-
        /* reload our services immediately */
        reload_services( False );
 
index 529b4c198d210078d05d8f7c2f7e1195e5bdc2fe..13e1971925aa818904a5c14a6aa0e820ad02641c 100644 (file)
@@ -1580,7 +1580,10 @@ WERROR _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S
                if ( is_disk_op )
                        become_root();
                        
-               ret = smbrun(command, NULL);
+               if ( (ret = smbrun(command, NULL)) == 0 ) {
+                       /* Tell everyone we updated smb.conf. */
+                       message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED, NULL, 0, False, NULL);
+               }
                
                if ( is_disk_op )
                        unbecome_root();
@@ -1591,9 +1594,6 @@ WERROR _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S
        
                if ( ret != 0 )
                        return WERR_ACCESS_DENIED;
-
-               /* Tell everyone we updated smb.conf. */
-               message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED, NULL, 0, False, NULL);
        } else {
                DEBUG(10,("_srv_net_share_set_info: No change to share name (%s)\n", share_name ));
        }
@@ -1725,7 +1725,10 @@ WERROR _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_S
        if ( is_disk_op )
                become_root();
 
-       ret = smbrun(command, NULL);
+       if ( (ret = smbrun(command, NULL)) == 0 ) {
+               /* Tell everyone we updated smb.conf. */
+               message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED, NULL, 0, False, NULL);
+       }
 
        if ( is_disk_op )
                unbecome_root();
@@ -1737,9 +1740,6 @@ WERROR _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_S
        if ( ret != 0 )
                return WERR_ACCESS_DENIED;
 
-       /* Tell everyone we updated smb.conf. */
-       message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED, NULL, 0, False, NULL);
-
        if (psd) {
                if (!set_share_security(p->mem_ctx, share_name, psd)) {
                        DEBUG(0,("_srv_net_share_add: Failed to add security info to share %s.\n", share_name ));
@@ -1808,7 +1808,10 @@ WERROR _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_S
        if ( is_disk_op )
                become_root();
 
-       ret = smbrun(command, NULL);
+       if ( (ret = smbrun(command, NULL)) == 0 ) {
+               /* Tell everyone we updated smb.conf. */
+               message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED, NULL, 0, False, NULL);
+       }
 
        if ( is_disk_op )
                unbecome_root();
@@ -1820,9 +1823,6 @@ WERROR _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_S
        if ( ret != 0 )
                return WERR_ACCESS_DENIED;
 
-       /* Tell everyone we updated smb.conf. */
-       message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED, NULL, 0, False, NULL);
-
        /* Delete the SD in the database. */
        delete_share_security(snum);