diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-08-17 03:06:20 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-08-17 03:06:20 +0000 |
commit | f2d538a105a61ce6d2852700fc328e15ac158827 (patch) | |
tree | 47c819007b231a5a8ebfcc7faa0c1354561366df /source3/smbd/nttrans.c | |
parent | c5e2c883c0415ca3c7e366357c8c6ba573713aa6 (diff) | |
download | samba-f2d538a105a61ce6d2852700fc328e15ac158827.tar.gz samba-f2d538a105a61ce6d2852700fc328e15ac158827.tar.xz samba-f2d538a105a61ce6d2852700fc328e15ac158827.zip |
some cleanups from the conversion of Pipes[] to a linked list. I also
removed most cases where a pnum is used and substituted a pipes_struct*.
in files.c I added a offset of 0x1000 to all file handles on the
wire. This makes it much less likely that bad parsing will give us the
wrong field.
(This used to be commit 8bc2627ff28d340db65bfa017daca2dc291d5ef7)
Diffstat (limited to 'source3/smbd/nttrans.c')
-rw-r--r-- | source3/smbd/nttrans.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 9bfdddf7045..31bfac25c8a 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -364,32 +364,33 @@ static int map_share_mode( uint32 desired_access, uint32 share_access, uint32 fi static int nt_open_pipe(char *fname, connection_struct *conn, char *inbuf, char *outbuf, int *ppnum) { - int pnum = -1; - uint16 vuid = SVAL(inbuf, smb_uid); - int i; + pipes_struct *p = NULL; - DEBUG(4,("nt_open_pipe: Opening pipe %s.\n", fname)); + uint16 vuid = SVAL(inbuf, smb_uid); + int i; + + DEBUG(4,("nt_open_pipe: Opening pipe %s.\n", fname)); - /* See if it is one we want to handle. */ - for( i = 0; known_nt_pipes[i]; i++ ) - if( strequal(fname,known_nt_pipes[i])) - break; + /* See if it is one we want to handle. */ + for( i = 0; known_nt_pipes[i]; i++ ) + if( strequal(fname,known_nt_pipes[i])) + break; - if ( known_nt_pipes[i] == NULL ) - return(ERROR(ERRSRV,ERRaccess)); + if ( known_nt_pipes[i] == NULL ) + return(ERROR(ERRSRV,ERRaccess)); - /* Strip \\ off the name. */ - fname++; + /* Strip \\ off the name. */ + fname++; - DEBUG(3,("nt_open_pipe: Known pipe %s opening.\n", fname)); + DEBUG(3,("nt_open_pipe: Known pipe %s opening.\n", fname)); - pnum = open_rpc_pipe_hnd(fname, conn, vuid); - if (pnum < 0) - return(ERROR(ERRSRV,ERRnofids)); + p = open_rpc_pipe_p(fname, conn, vuid); + if (!p) + return(ERROR(ERRSRV,ERRnofids)); - *ppnum = pnum + PIPE_HANDLE_OFFSET; /* Mark file handle up into high - range. */ - return 0; + *ppnum = p->pnum; + + return 0; } /**************************************************************************** @@ -1258,8 +1259,8 @@ static int call_nt_transact_ioctl(connection_struct *conn, int bufsize, char **ppsetup, char **ppparams, char **ppdata) { - DEBUG(0,("call_nt_transact_ioctl: Currently not implemented.\n")); - return(ERROR(ERRSRV,ERRnosupport)); + DEBUG(0,("call_nt_transact_ioctl: Currently not implemented.\n")); + return(ERROR(ERRSRV,ERRnosupport)); } /**************************************************************************** |