summaryrefslogtreecommitdiff
path: root/source3/smbd/pipes.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-09-12 23:50:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:30:41 -0500
commitd5c9d87946263b5f3e3c072aa99e8ac6a6c728b9 (patch)
tree7d54324e4b4e04b053bac0cf78888f868f3abcbe /source3/smbd/pipes.c
parent12f61e09d943ea7fc4149166077507b5b0b3b4e7 (diff)
downloadsamba-d5c9d87946263b5f3e3c072aa99e8ac6a6c728b9.tar.gz
samba-d5c9d87946263b5f3e3c072aa99e8ac6a6c728b9.tar.bz2
samba-d5c9d87946263b5f3e3c072aa99e8ac6a6c728b9.zip
r25118: More pstring elimination.
Jeremy. (This used to be commit 7632f8fb4003657591778d2b55f546d1737859d1)
Diffstat (limited to 'source3/smbd/pipes.c')
-rw-r--r--source3/smbd/pipes.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c
index f43e243453..9906bfb45b 100644
--- a/source3/smbd/pipes.c
+++ b/source3/smbd/pipes.c
@@ -55,15 +55,21 @@ extern struct pipe_id_info pipe_names[];
void reply_open_pipe_and_X(connection_struct *conn, struct smb_request *req)
{
- pstring fname;
- pstring pipe_name;
+ const char *fname = NULL;
+ char *pipe_name = NULL;
smb_np_struct *p;
int size=0,fmode=0,mtime=0,rmode=0;
int i;
+ TALLOC_CTX *ctx = talloc_tos();
/* XXXX we need to handle passed times, sattr and flags */
- srvstr_pull_buf(req->inbuf, req->flags2, pipe_name,
- smb_buf(req->inbuf), sizeof(pipe_name), STR_TERMINATE);
+ srvstr_pull_buf_talloc(ctx, req->inbuf, req->flags2, &pipe_name,
+ smb_buf(req->inbuf), STR_TERMINATE);
+ if (!pipe_name) {
+ reply_botherror(req, NT_STATUS_OBJECT_NAME_NOT_FOUND,
+ ERRDOS, ERRbadpipe);
+ return;
+ }
/* If the name doesn't start \PIPE\ then this is directed */
/* at a mailslot or something we really, really don't understand, */
@@ -89,7 +95,7 @@ void reply_open_pipe_and_X(connection_struct *conn, struct smb_request *req)
}
/* Strip \PIPE\ off the name. */
- pstrcpy(fname, pipe_name + PIPELEN);
+ fname = pipe_name + PIPELEN;
#if 0
/*