[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
[samba.git] / source / rpc_server / srv_pipe_hnd.c
index fc9025623248650aa7499a25764e6064770b6adb..91814979c5b6b37bde57005cc50fb8763d034804 100644 (file)
@@ -16,8 +16,7 @@
  *  GNU General Public License for more details.
  *  
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "includes.h"
@@ -66,7 +65,7 @@ static ssize_t read_from_internal_pipe(void *np_conn, char *data, size_t n,
                BOOL *is_data_outstanding);
 static ssize_t write_to_internal_pipe(void *np_conn, char *data, size_t n);
 static BOOL close_internal_rpc_pipe_hnd(void *np_conn);
-static void *make_internal_rpc_pipe_p(char *pipe_name, 
+static void *make_internal_rpc_pipe_p(const char *pipe_name, 
                              connection_struct *conn, uint16 vuid);
 
 /****************************************************************************
@@ -168,7 +167,7 @@ static BOOL pipe_init_outgoing_data(pipes_struct *p)
  Find first available pipe slot.
 ****************************************************************************/
 
-smb_np_struct *open_rpc_pipe_p(char *pipe_name, 
+smb_np_struct *open_rpc_pipe_p(const char *pipe_name, 
                              connection_struct *conn, uint16 vuid)
 {
        int i;
@@ -276,7 +275,7 @@ smb_np_struct *open_rpc_pipe_p(char *pipe_name,
  Make an internal namedpipes structure
 ****************************************************************************/
 
-static void *make_internal_rpc_pipe_p(char *pipe_name, 
+static void *make_internal_rpc_pipe_p(const char *pipe_name, 
                              connection_struct *conn, uint16 vuid)
 {
        pipes_struct *p;
@@ -351,6 +350,8 @@ static void *make_internal_rpc_pipe_p(char *pipe_name,
        /* Store the session key and NT_TOKEN */
        if (vuser) {
                p->session_key = data_blob(vuser->session_key.data, vuser->session_key.length);
+               p->pipe_user.nt_user_token = dup_nt_token(
+                       NULL, vuser->nt_user_token);
        }
 
        /*
@@ -1034,6 +1035,7 @@ static ssize_t read_from_internal_pipe(void *np_conn, char *data, size_t n,
        if(n > RPC_MAX_PDU_FRAG_LEN) {
                 DEBUG(5,("read_from_pipe: too large read (%u) requested on \
 pipe %s. We can only service %d sized reads.\n", (unsigned int)n, p->name, RPC_MAX_PDU_FRAG_LEN ));
+               n = RPC_MAX_PDU_FRAG_LEN;
        }
 
        /*
@@ -1247,10 +1249,8 @@ static BOOL close_internal_rpc_pipe_hnd(void *np_conn)
  Find an rpc pipe given a pipe handle in a buffer and an offset.
 ****************************************************************************/
 
-smb_np_struct *get_rpc_pipe_p(char *buf, int where)
+smb_np_struct *get_rpc_pipe_p(uint16 pnum)
 {
-       int pnum = SVAL(buf,where);
-
        if (chain_p) {
                return chain_p;
        }