From c4a84783a672734f695defbac25733e5cbf29430 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 11 Mar 2001 00:45:07 +0000 Subject: Added JF's new util. Jeremy. (This used to be commit 96bcfdcded7202a7bced58fae6534f1fcd4c4e36) --- source3/utils/rpccheck.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 source3/utils/rpccheck.c (limited to 'source3/utils/rpccheck.c') diff --git a/source3/utils/rpccheck.c b/source3/utils/rpccheck.c new file mode 100644 index 0000000000..f504463027 --- /dev/null +++ b/source3/utils/rpccheck.c @@ -0,0 +1,64 @@ +/* + Unix SMB/Netbios implementation. + Version 2.2. + + Copyright (C) Jean François Micouleau 2001 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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. +*/ + +#include "includes.h" + +extern int DEBUGLEVEL; + +main() +{ + char filter[]="0123456789ABCDEF"; + + char s[128]; + char d=0; + int x=0; + prs_struct ps; + TALLOC_CTX *ctx; + + /* change that struct */ + SAMR_R_QUERY_USERINFO rpc_stub; + + ZERO_STRUCT(rpc_stub); + + setup_logging("", True); + DEBUGLEVEL=10; + + ctx=talloc_init(); + + prs_init(&ps, 1600, 4, ctx, MARSHALL); + + while (scanf("%s", s)!=-1) { + if (strlen(s)==2 && strchr(filter, *s)!=NULL && strchr(filter, *(s+1))!=NULL) { + d=strtol(s, NULL, 16); + if(!prs_append_data(&ps, &d, 1)) + printf("error while reading data\n"); + } + } + + prs_switch_type(&ps, UNMARSHALL); + prs_set_offset(&ps, 0); + + /* change that call */ + if(!samr_io_r_query_userinfo("", &rpc_stub, &ps, 0)) + printf("error while UNMARSHALLING the data\n"); + + printf("\n"); +} -- cgit From 527e824293ee934ca5da0ef5424efe5ab7757248 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 4 Jul 2001 07:36:09 +0000 Subject: strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn. (This used to be commit c41fc06376d1a2b83690612304e85010b5e5f3cf) --- source3/utils/rpccheck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/utils/rpccheck.c') diff --git a/source3/utils/rpccheck.c b/source3/utils/rpccheck.c index f504463027..1b00d528ac 100644 --- a/source3/utils/rpccheck.c +++ b/source3/utils/rpccheck.c @@ -46,7 +46,7 @@ main() prs_init(&ps, 1600, 4, ctx, MARSHALL); while (scanf("%s", s)!=-1) { - if (strlen(s)==2 && strchr(filter, *s)!=NULL && strchr(filter, *(s+1))!=NULL) { + if (strlen(s)==2 && strchr_m(filter, *s)!=NULL && strchr_m(filter, *(s+1))!=NULL) { d=strtol(s, NULL, 16); if(!prs_append_data(&ps, &d, 1)) printf("error while reading data\n"); -- cgit From dc1fc3ee8ec2199bc73bb5d7ec711c6800f61d65 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 2 Oct 2001 04:29:50 +0000 Subject: Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. (This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e) --- source3/utils/rpccheck.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/utils/rpccheck.c') diff --git a/source3/utils/rpccheck.c b/source3/utils/rpccheck.c index 1b00d528ac..287b39bd1e 100644 --- a/source3/utils/rpccheck.c +++ b/source3/utils/rpccheck.c @@ -21,8 +21,6 @@ #include "includes.h" -extern int DEBUGLEVEL; - main() { char filter[]="0123456789ABCDEF"; -- cgit From a42efb497153dcca1fad227e28f5eaf41ee943c3 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 3 Oct 2001 21:10:29 +0000 Subject: fix some possible memleaks and not tested reallocs spotted by Andreas Moroder (This used to be commit d30939a091b48f4d77f7618c75668ae151a5592e) --- source3/utils/rpccheck.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/utils/rpccheck.c') diff --git a/source3/utils/rpccheck.c b/source3/utils/rpccheck.c index 287b39bd1e..3956310241 100644 --- a/source3/utils/rpccheck.c +++ b/source3/utils/rpccheck.c @@ -40,6 +40,7 @@ main() DEBUGLEVEL=10; ctx=talloc_init(); + if (!ctx) exit(1); prs_init(&ps, 1600, 4, ctx, MARSHALL); -- cgit From cd68afe31256ad60748b34f7318a180cfc2127cc Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 30 Jan 2002 06:08:46 +0000 Subject: Removed version number from file header. Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa) --- source3/utils/rpccheck.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/utils/rpccheck.c') diff --git a/source3/utils/rpccheck.c b/source3/utils/rpccheck.c index 3956310241..ab7286f8be 100644 --- a/source3/utils/rpccheck.c +++ b/source3/utils/rpccheck.c @@ -1,6 +1,5 @@ /* - Unix SMB/Netbios implementation. - Version 2.2. + Unix SMB/CIFS implementation. Copyright (C) Jean François Micouleau 2001 -- cgit From 98ac4503aca8f5a5a4268d89791e9a4491ce8645 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 23 Dec 2002 23:54:10 +0000 Subject: Finish adding strings to all talloc_init() calls. Jeremy. (This used to be commit aa8439a49ec4b9f433745fefa1e769e45398f4df) --- source3/utils/rpccheck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/utils/rpccheck.c') diff --git a/source3/utils/rpccheck.c b/source3/utils/rpccheck.c index ab7286f8be..ae109f69b6 100644 --- a/source3/utils/rpccheck.c +++ b/source3/utils/rpccheck.c @@ -38,7 +38,7 @@ main() setup_logging("", True); DEBUGLEVEL=10; - ctx=talloc_init(); + ctx=talloc_init("main"); if (!ctx) exit(1); prs_init(&ps, 1600, 4, ctx, MARSHALL); -- cgit From c507ebe56741d773bf6e7ad547863a2da1aee687 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 10 May 2003 10:53:48 +0000 Subject: Patch from metze and me that adds dummy smb_register_*() functions so that is now possible to, for example, load a module which contains an auth method into a binary without the auth/ subsystem built in. (This used to be commit 74d9ecfe2dd7364643d32acb62ade957bd71cd0d) --- source3/utils/rpccheck.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/utils/rpccheck.c') diff --git a/source3/utils/rpccheck.c b/source3/utils/rpccheck.c index ae109f69b6..11a2a9d8ba 100644 --- a/source3/utils/rpccheck.c +++ b/source3/utils/rpccheck.c @@ -20,6 +20,8 @@ #include "includes.h" +#include "module_dummy.h" + main() { char filter[]="0123456789ABCDEF"; -- cgit From 0914e541f5480834c1b0ddc98b5f71f7f7abf9cb Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 10 May 2003 11:49:51 +0000 Subject: Reverse previous patch from Stefan and me after comments by Andrew Bartlett (This used to be commit d817eaf0ecca2d878ab1ffcf7a747a02d71c811e) --- source3/utils/rpccheck.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/utils/rpccheck.c') diff --git a/source3/utils/rpccheck.c b/source3/utils/rpccheck.c index 11a2a9d8ba..ae109f69b6 100644 --- a/source3/utils/rpccheck.c +++ b/source3/utils/rpccheck.c @@ -20,8 +20,6 @@ #include "includes.h" -#include "module_dummy.h" - main() { char filter[]="0123456789ABCDEF"; -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/utils/rpccheck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/utils/rpccheck.c') diff --git a/source3/utils/rpccheck.c b/source3/utils/rpccheck.c index ae109f69b6..b8930075bf 100644 --- a/source3/utils/rpccheck.c +++ b/source3/utils/rpccheck.c @@ -5,7 +5,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, -- cgit From 5e54558c6dea67b56bbfaba5698f3a434d3dffb6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 00:52:41 +0000 Subject: r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07) --- source3/utils/rpccheck.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/utils/rpccheck.c') diff --git a/source3/utils/rpccheck.c b/source3/utils/rpccheck.c index b8930075bf..63c2f14601 100644 --- a/source3/utils/rpccheck.c +++ b/source3/utils/rpccheck.c @@ -14,8 +14,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 . */ #include "includes.h" -- cgit From e06aa46b9fab1e107fea8f6453fb13deffa91e96 Mon Sep 17 00:00:00 2001 From: Marc VanHeyningen Date: Fri, 14 Mar 2008 14:26:28 -0800 Subject: Coverity fixes (This used to be commit 3fc85d22590550f0539215d020e4411bf5b14363) --- source3/utils/rpccheck.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/utils/rpccheck.c') diff --git a/source3/utils/rpccheck.c b/source3/utils/rpccheck.c index 63c2f14601..87632db16d 100644 --- a/source3/utils/rpccheck.c +++ b/source3/utils/rpccheck.c @@ -40,7 +40,8 @@ main() ctx=talloc_init("main"); if (!ctx) exit(1); - prs_init(&ps, 1600, 4, ctx, MARSHALL); + if (!prs_init(&ps, 1600, 4, ctx, MARSHALL)) + exit(1); while (scanf("%s", s)!=-1) { if (strlen(s)==2 && strchr_m(filter, *s)!=NULL && strchr_m(filter, *(s+1))!=NULL) { -- cgit