[SCM] Samba Shared Repository - branch master updated -
release-4-0-0alpha8-75-g2579afc
Günther Deschner
gd at samba.org
Fri Jun 26 07:35:35 GMT 2009
The branch, master has been updated
via 2579afc89710565bea0b16aa894b61fbb7776f26 (commit)
from 6395bc55db6b5926c42d3419084a6ccc1256c9c7 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 2579afc89710565bea0b16aa894b61fbb7776f26
Author: Günther Deschner <gd at samba.org>
Date: Thu Jun 25 17:43:28 2009 +0200
s3-vlp: drastically shrink size and dependencies of the virtual line printer.
This gets vlp from 13M down to 214K on my box.
Guenther
-----------------------------------------------------------------------
Summary of changes:
source3/Makefile.in | 17 ++++++-----------
source3/printing/tests/vlp.c | 19 ++++++++-----------
2 files changed, 14 insertions(+), 22 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/Makefile.in b/source3/Makefile.in
index a6c918e..c04b205 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1225,13 +1225,10 @@ NTLM_AUTH_OBJ = ${NTLM_AUTH_OBJ1} $(LIBSAMBA_OBJ) $(POPT_LIB_OBJ) \
$(LIBNDR_GEN_OBJ0) $(LIBNDR_GEN_OBJ1) @BUILD_INIPARSER@
-VLP_OBJ1 = printing/tests/vlp.o $(RPC_CLIENT_OBJ1) $(RPC_PARSE_OBJ2) $(RPC_CLIENT_OBJ) ../librpc/rpc/binding.o
-
-VLP_OBJ = $(VLP_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) \
- $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) $(LIBMSRPC_GEN_OBJ) \
- $(READLINE_OBJ) $(POPT_LIB_OBJ) \
- $(PASSDB_OBJ) $(SMBLDAP_OBJ) $(GROUPDB_OBJ) $(LDB_OBJ) \
- $(DISPLAY_SEC_OBJ)
+VLP_OBJ = printing/tests/vlp.o \
+ ../lib/util/util_tdb.o \
+ $(LIBSAMBAUTIL_OBJ) \
+ param/util.o
RPC_OPEN_TCP_OBJ = torture/rpc_open_tcp.o \
$(LIBSMB_OBJ) \
@@ -2515,13 +2512,11 @@ bin/winbindd at EXEEXT@: $(BINARY_PREREQS) $(WINBINDD_OBJ) @BUILD_POPT@ @LIBTALLOC_
$(PASSDB_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(LIBWBCLIENT_LIBS) \
$(ZLIB_LIBS)
-bin/vlp at EXEEXT@: $(BINARY_PREREQS) $(VLP_OBJ) @LIBTALLOC_TARGET@ @LIBTDB_TARGET@ @LIBWBCLIENT_TARGET@
+bin/vlp at EXEEXT@: $(BINARY_PREREQS) $(VLP_OBJ) @LIBTDB_TARGET@
@echo "Linking $@"
@$(CC) -o $@ $(VLP_OBJ) $(LDFLAGS) $(DYNEXP) \
$(TERMLDFLAGS) $(TERMLIBS) $(LIBS) $(POPT_LIBS) \
- $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
- $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(LIBWBCLIENT_LIBS) \
- $(ZLIB_LIBS)
+ $(LIBTDB_LIBS)
@WINBIND_NSS@: $(BINARY_PREREQS) $(WINBIND_NSS_OBJ)
@echo "Linking $@"
diff --git a/source3/printing/tests/vlp.c b/source3/printing/tests/vlp.c
index 5fc363f..48b7120 100644
--- a/source3/printing/tests/vlp.c
+++ b/source3/printing/tests/vlp.c
@@ -21,6 +21,10 @@
#include "includes.h"
+#ifdef malloc
+#undef malloc
+#endif
+
#define PRINT_FIRSTJOB "100"
static TDB_CONTEXT *tdb;
@@ -215,7 +219,6 @@ static int print_command(int argc, char **argv)
struct passwd *pw;
TDB_DATA value, queue;
struct vlp_job job;
- int i;
if (argc < 3) {
printf("Usage: print <printername> <jobname>\n");
@@ -228,18 +231,13 @@ static int print_command(int argc, char **argv)
/* Create a job record */
- for (i = 2; i < argc; i++) {
- fstrcat(job.jobname, argv[i]);
- if (i < argc - 1) {
- fstrcat(job.jobname, " ");
- }
- }
+ slprintf(job.jobname, sizeof(job.jobname) - 1, "%s", argv[2]);
if (!(pw = getpwuid(getuid()))) {
return 1;
}
- fstrcpy(job.owner, pw->pw_name);
+ slprintf(job.owner, sizeof(job.owner) - 1, "%s", pw->pw_name);
job.jobid = next_jobnum(printer);
job.size = 666;
@@ -255,8 +253,7 @@ static int print_command(int argc, char **argv)
/* Add job to end of queue */
- queue.dptr = (unsigned char *)SMB_MALLOC(value.dsize +
- sizeof(struct vlp_job));
+ queue.dptr = (unsigned char *)malloc(value.dsize + sizeof(struct vlp_job));
if (!queue.dptr) return 1;
memcpy(queue.dptr, value.dptr, value.dsize);
@@ -382,7 +379,7 @@ int main(int argc, char **argv)
return 1;
}
- if (!strnequal(argv[1], "tdbfile", strlen("tdbfile"))) {
+ if (strncmp(argv[1], "tdbfile", strlen("tdbfile")) != 0) {
usage();
return 1;
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list