vlmcsd-svn906-2016-06-05-Hotbird64

This commit is contained in:
Wind4 2016-06-06 10:36:00 +08:00
parent 1c86f7a6bf
commit c479a67c2c
55 changed files with 5728 additions and 21773 deletions

View File

@ -5,7 +5,10 @@
PROGRAM_NAME ?= vlmcsd PROGRAM_NAME ?= vlmcsd
CLIENT_NAME ?= vlmcs CLIENT_NAME ?= vlmcs
MULTI_NAME ?= vlmcsdmulti MULTI_NAME ?= vlmcsdmulti
OBJ_NAME ?= libkms-static.o
A_NAME ?= libkms.a
CONFIG ?= config.h CONFIG ?= config.h
COMPILER_LANGUAGE ?= c
# crypto library to use for standard algos, could save ~1-2kb ;) # crypto library to use for standard algos, could save ~1-2kb ;)
# can be either 'openssl', 'polarssl' or anything other for internal impl # can be either 'openssl', 'polarssl' or anything other for internal impl
@ -34,49 +37,72 @@ endif
ifneq (,$(findstring androideabi,$(TARGETPLATFORM))) ifneq (,$(findstring androideabi,$(TARGETPLATFORM)))
ANDROID := 1 ANDROID := 1
UNIX := 1 UNIX := 1
ELF := 1
endif endif
ifneq (,$(findstring minix,$(TARGETPLATFORM))) ifneq (,$(findstring minix,$(TARGETPLATFORM)))
MINIX := 1 MINIX := 1
UNIX := 1 UNIX := 1
ELF := 1
endif endif
ifneq (,$(findstring mingw,$(TARGETPLATFORM))) ifneq (,$(findstring mingw,$(TARGETPLATFORM)))
MINGW := 1 MINGW := 1
WIN := 1 WIN := 1
PE := 1
endif endif
ifneq (,$(findstring cygwin,$(TARGETPLATFORM))) ifneq (,$(findstring cygwin,$(TARGETPLATFORM)))
CYGWIN := 1 CYGWIN := 1
WIN := 1 WIN := 1
PE := 1
endif
ifneq (,$(findstring cygnus,$(TARGETPLATFORM)))
CYGWIN := 1
WIN := 1
PE := 1
endif endif
ifneq (,$(findstring freebsd,$(TARGETPLATFORM))) ifneq (,$(findstring freebsd,$(TARGETPLATFORM)))
FREEBSD := 1 FREEBSD := 1
UNIX := 1 UNIX := 1
BSD := 1 BSD := 1
ELF := 1
endif endif
ifneq (,$(findstring netbsd,$(TARGETPLATFORM))) ifneq (,$(findstring netbsd,$(TARGETPLATFORM)))
NETBSD := 1 NETBSD := 1
UNIX := 1 UNIX := 1
BSD := 1 BSD := 1
ELF := 1
endif endif
ifneq (,$(findstring openbsd,$(TARGETPLATFORM))) ifneq (,$(findstring openbsd,$(TARGETPLATFORM)))
OPENBSD := 1 OPENBSD := 1
UNIX := 1 UNIX := 1
BSD := 1 BSD := 1
ELF := 1
endif endif
ifneq (,$(findstring solaris,$(TARGETPLATFORM))) ifneq (,$(findstring solaris,$(TARGETPLATFORM)))
SOLARIS := 1 SOLARIS := 1
UNIX := 1 UNIX := 1
ELF := 1
endif endif
ifneq (,$(findstring linux,$(TARGETPLATFORM))) ifneq (,$(findstring linux,$(TARGETPLATFORM)))
LINUX := 1 LINUX := 1
UNIX := 1 UNIX := 1
ELF := 1
endif
ifneq (,$(findstring gnu,$(TARGETPLATFORM)))
ifeq (,$(findstring linux,$(TARGETPLATFORM)))
UNIX := 1
HURD := 1
ELF := 1
endif
endif endif
ifeq ($(CYGWIN),1) ifeq ($(CYGWIN),1)
@ -89,12 +115,25 @@ else
DLL_NAME ?= libkms.so DLL_NAME ?= libkms.so
endif endif
BASECFLAGS = -DCONFIG=\"$(CONFIG)\" -DBUILD_TIME=$(shell date '+%s') -g -Os -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections BASECFLAGS = -DVLMCSD_COMPILER=\"$(notdir $(CC))\" -DVLMCSD_PLATFORM=\"$(TARGETPLATFORM)\" -DCONFIG=\"$(CONFIG)\" -DBUILD_TIME=$(shell date '+%s') -g -Os -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections
BASELDFLAGS = BASELDFLAGS =
STRIPFLAGS = STRIPFLAGS =
CLIENTLDFLAGS = CLIENTLDFLAGS =
SERVERLDFLAGS = SERVERLDFLAGS =
ifndef SAFE_MODE
BASECFLAGS += -fvisibility=hidden -pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants
ifeq ($(ELF),1)
BASELDFLAGS += -Wl,-z,norelro
endif
ifneq (,$(findstring gcc,$(notdir $(CC))))
BASECFLAGS += -flto
endif
endif
ifeq ($(NOLIBS),1) ifeq ($(NOLIBS),1)
NOLRESOLV=1 NOLRESOLV=1
NOLPTHREAD=1 NOLPTHREAD=1
@ -105,20 +144,24 @@ ifneq ($(NO_DNS),1)
ifneq ($(NOLRESOLV),1) ifneq ($(NOLRESOLV),1)
ifeq ($(MINGW),1) ifeq ($(MINGW),1)
BASELDFLAGS += -ldnsapi CLIENTLDFLAGS += -ldnsapi
endif endif
ifeq ($(LINUX),1) ifeq ($(LINUX),1)
BASELDFLAGS += -lresolv CLIENTLDFLAGS += -lresolv
endif
ifeq ($(HURD),1)
CLIENTLDFLAGS += -lresolv
endif endif
ifeq ($(DARWIN),1) ifeq ($(DARWIN),1)
BASELDFLAGS += -lresolv CLIENTLDFLAGS += -lresolv
endif endif
ifeq ($(CYGWIN),1) ifeq ($(CYGWIN),1)
DNS_PARSER := internal DNS_PARSER := internal
BASELDFLAGS += -lresolv CLIENTLDFLAGS += -lresolv
endif endif
ifeq ($(OPENBSD),1) ifeq ($(OPENBSD),1)
@ -126,7 +169,7 @@ ifneq ($(NO_DNS),1)
endif endif
ifeq ($(SOLARIS),1) ifeq ($(SOLARIS),1)
BASELDFLAGS += -lresolv CLIENTLDFLAGS += -lresolv
endif endif
endif endif
@ -155,16 +198,18 @@ else
STRIPFLAGS += -s STRIPFLAGS += -s
endif endif
LIBRARY_CFLAGS = -DSIMPLE_SOCKETS -DNO_TIMEOUT -DNO_SIGHUP -DNO_CL_PIDS -DNO_EXTENDED_PRODUCT_LIST -DNO_BASIC_PRODUCT_LIST -DNO_LOG -DNO_RANDOM_EPID -DNO_INI_FILE -DNO_INI_FILE -DNO_HELP -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_USER_SWITCH -DNO_VERBOSE_LOG -DNO_LIMIT -DNO_VERSION_INFORMATION
ifeq ($(FEATURES), embedded) ifeq ($(FEATURES), embedded)
BASECFLAGS += -DNO_HELP -DNO_USER_SWITCH -DNO_BASIC_PRODUCT_LIST -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_VERBOSE_LOG BASECFLAGS += -DNO_HELP -DNO_USER_SWITCH -DNO_BASIC_PRODUCT_LIST -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_VERBOSE_LOG -DNO_VERSION_INFORMATION
else ifeq ($(FEATURES), autostart) else ifeq ($(FEATURES), autostart)
BASECFLAGS += -DNO_HELP BASECFLAGS += -DNO_HELP -DNO_VERSION_INFORMATION
else ifeq ($(FEATURES), minimum) else ifeq ($(FEATURES), minimum)
BASECFLAGS += -DNO_TIMEOUT -DNO_SIGHUP -DNO_CL_PIDS -DNO_EXTENDED_PRODUCT_LIST -DNO_BASIC_PRODUCT_LIST -DNO_LOG -DNO_RANDOM_EPID -DNO_INI_FILE -DNO_INI_FILE -DNO_HELP -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_USER_SWITCH -DNO_VERBOSE_LOG -DNO_LIMIT BASECFLAGS += $(LIBRARY_CFLAGS)
else ifeq ($(FEATURES), most) else ifeq ($(FEATURES), most)
BASECFLAGS += -DNO_SIGHUP -DNO_PID_FILE -DNO_LIMIT BASECFLAGS += -DNO_SIGHUP -DNO_PID_FILE -DNO_LIMIT
else ifeq ($(FEATURES), inetd) else ifeq ($(FEATURES), inetd)
BASECFLAGS += -DNO_SIGHUP -DNO_SOCKETS -DNO_PID_FILE -DNO_LIMIT BASECFLAGS += -DNO_SIGHUP -DNO_SOCKETS -DNO_PID_FILE -DNO_LIMIT -DNO_VERSION_INFORMATION
else ifeq ($(FEATURES), fixedepids) else ifeq ($(FEATURES), fixedepids)
BASECFLAGS += -DNO_SIGHUP -DNO_CL_PIDS -DNO_RANDOM_EPID -DNO_INI_FILE BASECFLAGS += -DNO_SIGHUP -DNO_CL_PIDS -DNO_RANDOM_EPID -DNO_INI_FILE
endif endif
@ -202,7 +247,7 @@ ifdef HWID
endif endif
ifdef TERMINAL_WIDTH ifdef TERMINAL_WIDTH
BASECFLAGS += -DTERMINAL_FIXED_WIDTH=$(TERMINAL_WIDTH) BASECFLAGS += -DTERMINAL_FIXED_WIDTH=$(TERMINAL_WIDTH) -DDISPLAY_WIDTH=\"$(TERMINAL_WIDTH)\"
endif endif
ifeq ($(NOPROCFS), 1) ifeq ($(NOPROCFS), 1)
@ -216,13 +261,15 @@ endif
ifneq ($(ANDROID), 1) ifneq ($(ANDROID), 1)
ifneq ($(MINIX), 1) ifneq ($(MINIX), 1)
ifneq ($(NOLPTHREAD), 1) ifneq ($(NOLPTHREAD), 1)
ifeq ($(findstring NO_LIMIT,$(CFLAGS) $(BASECFLAGS)),)
BASELDFLAGS += -lpthread ifeq ($(THREADS), 1)
SERVERLDFLAGS += -lpthread
endif endif
ifneq ($(findstring USE_THREADS,$(BASECFLAGS)),) ifeq (,$(findstring NO_LIMIT,$(CFLAGS) $(BASECFLAGS)))
BASELDFLAGS += -lpthread SERVERLDFLAGS += -lpthread
endif endif
endif endif
endif endif
endif endif
@ -283,6 +330,7 @@ ifeq ($(MSRPC),1)
VLMCSD_SRCS += msrpc-server.c VLMCSD_SRCS += msrpc-server.c
VLMCS_SRCS += msrpc-client.c VLMCS_SRCS += msrpc-client.c
MULTI_SRCS += msrpc-server.c msrpc-client.c MULTI_SRCS += msrpc-server.c msrpc-client.c
DLL_SRCS += msrpc-server.c
BASECFLAGS += -DUSE_MSRPC -Wno-unknown-pragmas BASECFLAGS += -DUSE_MSRPC -Wno-unknown-pragmas
BASELDFLAGS += -lrpcrt4 BASELDFLAGS += -lrpcrt4
else else
@ -312,7 +360,6 @@ else ifeq ($(CRYPTO), polarssl)
else ifeq ($(CRYPTO), windows) else ifeq ($(CRYPTO), windows)
BASECFLAGS += -D_CRYPTO_WINDOWS BASECFLAGS += -D_CRYPTO_WINDOWS
SRCS += crypto_windows.c SRCS += crypto_windows.c
#BASELDFLAGS += -lpolarssl
else else
BASECFLAGS += -D_CRYPTO_INTERNAL BASECFLAGS += -D_CRYPTO_INTERNAL
SRCS += crypto_internal.c SRCS += crypto_internal.c
@ -332,9 +379,12 @@ endif
ifeq ($(VERBOSE),3) ifeq ($(VERBOSE),3)
COMPILER := $(shell printf "%-40s" $(notdir $(CC))) COMPILER := $(shell printf "%-40s" $(notdir $(CC)))
ARCHIVER := $(shell printf "%-40s" $(notdir $(AR)))
endif endif
ifeq ($(CAT),2) ARCMD := AR
ifdef CAT
LDCMD := CC/LD LDCMD := CC/LD
else else
LDCMD := LD LDCMD := LD
@ -344,99 +394,96 @@ endif
%.o: %.c %.o: %.c
ifeq ($(VERBOSE),1) ifeq ($(VERBOSE),1)
$(CC) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $< $(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $<
ifeq ($(DEPENDENCIES),1) ifeq ($(DEPENDENCIES),1)
$(CC) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $< $(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $<
endif endif
else else
@echo "$(COMPILER) CC $@ <- $<" @echo "$(COMPILER) CC $@ <- $<"
@$(CC) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $< @$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $<
ifeq ($(DEPENDENCIES),1) ifeq ($(DEPENDENCIES),1)
@echo "$(COMPILER) DEP $*.d <- $<" @echo "$(COMPILER) DEP $*.d <- $<"
@$(CC) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $< @$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $<
endif endif
endif endif
vlmcsd_all.c: $(VLMCSD_SRCS)
ifeq ($(VERBOSE),1)
cat $^ > $@
else
@echo "$(COMPILER) CAT $@ <- $^"
@cat $^ > $@
endif
vlmcs_all.c: $(VLMCS_SRCS)
ifeq ($(VERBOSE),1)
cat $^ > $@
else
@echo "$(COMPILER) CAT $@ <- $^"
@cat $^ > $@
endif
vlmcsdmulti_all.c: $(MULTI_SRCS)
ifeq ($(VERBOSE),1)
cat $^ > $@
else
@echo "$(COMPILER) CAT $@ <- $^"
@cat $^ > $@
endif
ifdef CAT ifdef CAT
ifeq ($(CAT),2) BUILDCOMMAND = cat $^ | $(CC) -x$(COMPILER_LANGUAGE) -o $@ -
$(PROGRAM_NAME): vlmcsd_all.c VLMCSD_PREREQUISITES = $(VLMCSD_SRCS)
VLMCS_PREREQUISITES = $(VLMCS_SRCS)
MULTI_PREREQUISITES = $(MULTI_SRCS)
DLL_PREREQUISITES = $(DLL_SRCS)
OBJ_PREREQUISITES = $(DLL_SRCS)
else else
$(PROGRAM_NAME): vlmcsd_all.o BUILDCOMMAND = $(CC) -o $@ $^
VLMCSD_PREREQUISITES = $(VLMCSD_OBJS)
VLMCS_PREREQUISITES = $(VLMCS_OBJS)
MULTI_PREREQUISITES = $(MULTI_OBJS)
DLL_PREREQUISITES = $(DLL_OBJS)
OBJ_PREREQUISITES = $(DLL_OBJS)
endif endif
ifeq ($(VERBOSE),1)
BUILDCOMMANDPREFIX = +
else else
$(PROGRAM_NAME): $(VLMCSD_OBJS) BUILDCOMMANDPREFIX = +@
endif endif
ifeq ($(VERBOSE),1)
+$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) INFOCOMMAND = +@echo "$(COMPILER) $(LDCMD) $@ <- $^"
else ARINFOCOMMAND = +@echo "$(ARCHIVER) $(ARCMD) $@ <. $^"
+@echo "$(COMPILER) $(LDCMD) $@ <- $^"
+@$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) VLMCSD_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(SERVERLDFLAGS)
VLMCS_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(CLIENTLDFLAGS)
MULTI_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(CLIENTLDFLAGS) $(SERVERLDFLAGS)
DLL_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -shared -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC
OBJ_COMMAND = $(BUILDCOMMANDPREFIX)$(BUILDCOMMAND) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) $(SERVERLDFLAGS) -fvisibility=hidden -c -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC
$(PROGRAM_NAME): $(VLMCSD_PREREQUISITES)
ifneq ($(VERBOSE),1)
$(INFOCOMMAND)
endif endif
$(VLMCSD_COMMAND)
$(CLIENT_NAME): $(VLMCS_PREREQUISITES)
ifneq ($(VERBOSE),1)
$(INFOCOMMAND)
endif
$(VLMCS_COMMAND)
$(MULTI_NAME): $(MULTI_PREREQUISITES)
ifneq ($(VERBOSE),1)
$(INFOCOMMAND)
endif
$(MULTI_COMMAND)
$(DLL_NAME): $(DLL_PREREQUISITES)
ifneq ($(VERBOSE),1)
$(INFOCOMMAND)
endif
$(DLL_COMMAND)
ifndef CAT
$(OBJ_NAME):
+@echo Cannot make $@ without CAT defined. Please create $(A_NAME)
else
$(OBJ_NAME): $(OBJ_PREREQUISITES)
ifneq ($(VERBOSE),1)
$(INFOCOMMAND)
endif
$(OBJ_COMMAND)
endif
ifdef CAT ifdef CAT
ifeq ($(CAT),2) $(A_NAME): $(OBJ_NAME)
$(CLIENT_NAME): vlmcs_all.c
else else
$(CLIENT_NAME): vlmcs_all.o $(A_NAME): BASECFLAGS += -fvisibility=hidden -DIS_LIBRARY=1 $(LIBRARY_CFLAGS) -UNO_SOCKETS -UUSE_MSRPC
$(A_NAME): $(DLL_OBJS)
endif endif
else ifneq ($(VERBOSE),1)
$(CLIENT_NAME): $(VLMCS_OBJS) $(ARINFOCOMMAND)
endif
ifeq ($(VERBOSE),1)
+$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
else
+@echo "$(COMPILER) $(LDCMD) $@ <- $^"
+@$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
endif endif
+@rm -f $@
ifdef CAT $(BUILDCOMMANDPREFIX)$(AR) rcs $@ $^
ifeq ($(CAT),2)
$(MULTI_NAME): vlmcsdmulti_all.c
else
$(MULTI_NAME): vlmcsdmulti_all.o
endif
else
$(MULTI_NAME): $(MULTI_OBJS)
endif
ifeq ($(VERBOSE),1)
+$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
else
+@echo "$(COMPILER) $(LDCMD) $@ <- $^"
+@$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
endif
$(DLL_NAME): $(DLL_SRCS)
ifeq ($(VERBOSE),1)
+$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) -shared -DIS_LIBRARY=1 -UNO_SOCKETS -UUSE_MSRPC
else
+@echo "$(COMPILER) $(LDCMD) $@ <- $^"
+@$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) -shared -DIS_LIBRARY=1 -UNO_SOCKETS -UUSE_MSRPC
endif
%.pdf : % %.pdf : %
ifeq ($(shell uname), Darwin) ifeq ($(shell uname), Darwin)
@ -467,10 +514,10 @@ htmldocs : $(HTMLDOCS)
alldocs : $(UNIXDOCS) $(HTMLDOCS) $(PDFDOCS) $(DOSDOCS) alldocs : $(UNIXDOCS) $(HTMLDOCS) $(PDFDOCS) $(DOSDOCS)
clean: clean:
rm -f *.o *.d *_all.c $(PROGRAM_NAME) $(MULTI_NAME) $(DLL_NAME) $(CLIENT_NAME) $(PDFDOCS) $(DOSDOCS) $(UNIXDOCS) $(HTMLDOCS) rm -f *.o *.d *_all.c libkms_all_*.c $(PROGRAM_NAME) $(MULTI_NAME) $(DLL_NAME) $(CLIENT_NAME) $(PDFDOCS) $(DOSDOCS) $(UNIXDOCS) $(HTMLDOCS) $(OBJ_NAME) $(A_NAME) *.a
help: help:
@echo "Type:" @echo "Type"
@echo " ${MAKE} - to build $(PROGRAM_NAME) and $(CLIENT_NAME)" @echo " ${MAKE} - to build $(PROGRAM_NAME) and $(CLIENT_NAME)"
@echo " ${MAKE} clean - to remove $(PROGRAM_NAME) and $(CLIENT_NAME)" @echo " ${MAKE} clean - to remove $(PROGRAM_NAME) and $(CLIENT_NAME)"
@echo " ${MAKE} help - to see this help" @echo " ${MAKE} help - to see this help"
@ -485,8 +532,9 @@ help:
@echo " ${MAKE} $(CLIENT_NAME) - to build the client only." @echo " ${MAKE} $(CLIENT_NAME) - to build the client only."
@echo " ${MAKE} $(MULTI_NAME) - to build $(PROGRAM_NAME) and $(CLIENT_NAME) in a single multi-call binary" @echo " ${MAKE} $(MULTI_NAME) - to build $(PROGRAM_NAME) and $(CLIENT_NAME) in a single multi-call binary"
@echo " ${MAKE} $(DLL_NAME) - to build the shared library $(DLL_NAME)" @echo " ${MAKE} $(DLL_NAME) - to build the shared library $(DLL_NAME)"
@echo " ${MAKE} $(A_NAME) - to build the static library $(A_NAME)"
@echo "" @echo ""
@echo "Options:" @echo "Options"
@echo " CONFIG=<x> Compile <x> as instead of config.h." @echo " CONFIG=<x> Compile <x> as instead of config.h."
@echo " INI=<x> Compile $(PROGRAM_NAME) with default ini file <x>" @echo " INI=<x> Compile $(PROGRAM_NAME) with default ini file <x>"
@echo " PROGRAM_NAME=<x> Use <x> as output file name for the KMS server. Defaults to vlmcsd." @echo " PROGRAM_NAME=<x> Use <x> as output file name for the KMS server. Defaults to vlmcsd."
@ -498,7 +546,10 @@ help:
@echo " CRYPTO=openssl_with_aes_soft EXPERIMENTAL: Use openssl for SHA256/HMAC and AES calculations (software)." @echo " CRYPTO=openssl_with_aes_soft EXPERIMENTAL: Use openssl for SHA256/HMAC and AES calculations (software)."
@echo " CRYPTO=polarssl Use polarssl instead of internal crypto code for SHA256/HMAC calculations." @echo " CRYPTO=polarssl Use polarssl instead of internal crypto code for SHA256/HMAC calculations."
@echo " CRYPTO=windows Use Windows CryptoAPI instead of internal crypto code for SHA256/HMAC calculations." @echo " CRYPTO=windows Use Windows CryptoAPI instead of internal crypto code for SHA256/HMAC calculations."
@echo " MSRPC=1 Use Microsoft RPC instead of vlmcsd's internal RPC. Only works with Windows and Cygwin targets."
@echo " CC=<x> Use compiler <x>. Supported compilers are gcc, icc, tcc and clang. Others may or may not work." @echo " CC=<x> Use compiler <x>. Supported compilers are gcc, icc, tcc and clang. Others may or may not work."
@echo " AR=<x> Use <x> instead of ar to build $(A_NAME). Set to gcc-ar if you want to use gcc's LTO feature."
@echo " COMPILER_LANGUAGE=<x> May be c or c++."
@echo " TERMINAL_WIDTH=<x> Assume a fixed terminal width of <x> columns. Use in case of problems only." @echo " TERMINAL_WIDTH=<x> Assume a fixed terminal width of <x> columns. Use in case of problems only."
@echo " VLMCSD_VERSION=<x> Sets <x> as your version identifier. Defaults to \"private build\"." @echo " VLMCSD_VERSION=<x> Sets <x> as your version identifier. Defaults to \"private build\"."
@echo " CFLAGS=<x> Pass <x> as additional arguments to the compiler." @echo " CFLAGS=<x> Pass <x> as additional arguments to the compiler."
@ -522,7 +573,7 @@ help:
@echo " FEATURES=minimum Compiles only basic features of $(PROGRAM_NAME)." @echo " FEATURES=minimum Compiles only basic features of $(PROGRAM_NAME)."
@echo " FEATURES=fixedepids $(PROGRAM_NAME) only uses bultin internal ePIDs." @echo " FEATURES=fixedepids $(PROGRAM_NAME) only uses bultin internal ePIDs."
@echo "" @echo ""
@echo "Useful CFLAGS to save memory when running $(PROGRAM_NAME) on very small embedded devices (finer control than FEATURES=):" @echo "Useful CFLAGS to save memory when running $(PROGRAM_NAME) on very small embedded devices (finer control than FEATURES=)"
@echo " -DNO_EXTENDED_PRODUCT_LIST Don't compile the detailed product list." @echo " -DNO_EXTENDED_PRODUCT_LIST Don't compile the detailed product list."
@echo " -DNO_BASIC_PRODUCT_LIST Don't compile the basic product list." @echo " -DNO_BASIC_PRODUCT_LIST Don't compile the basic product list."
@echo " -DNO_VERBOSE_LOG Don't support verbose logging. Removes -v option." @echo " -DNO_VERBOSE_LOG Don't support verbose logging. Removes -v option."
@ -533,26 +584,29 @@ help:
@echo " -DNO_USER_SWITCH Don't support changing uid/gid after program start. Removes -u and -g options." @echo " -DNO_USER_SWITCH Don't support changing uid/gid after program start. Removes -u and -g options."
@echo " -DNO_HELP Don't support command line help." @echo " -DNO_HELP Don't support command line help."
@echo " -DNO_CUSTOM_INTERVALS Don't support custom intervals for retry and refresh activation. Removes -A and -R options." @echo " -DNO_CUSTOM_INTERVALS Don't support custom intervals for retry and refresh activation. Removes -A and -R options."
@echo " -DNO_FREEBIND Don't support binding to foreign IP addresses. Removes -F0 and -F1 options. Only affects FreeBSD and Linux."
@echo " -DSIMPLE_SOCKETS Compile $(PROGRAM_NAME) with basic socket support only. Removes -L option."
@echo " -DNO_SOCKETS Don't support standalone operation. Requires an internet superserver to start $(PROGRAM_NAME)." @echo " -DNO_SOCKETS Don't support standalone operation. Requires an internet superserver to start $(PROGRAM_NAME)."
@echo " -DNO_CL_PIDS Don't support specifying ePIDs and HwId from the command line in $(PROGRAM_NAME)." @echo " -DNO_CL_PIDS Don't support specifying ePIDs and HwId from the command line in $(PROGRAM_NAME)."
@echo " -DNO_LIMIT Don't support limiting concurrent clients in $(PROGRAM_NAME)." @echo " -DNO_LIMIT Don't support limiting concurrent clients in $(PROGRAM_NAME)."
@echo " -DNO_SIGHUP Don't support SIGHUP handling in $(PROGRAM_NAME)." @echo " -DNO_SIGHUP Don't support SIGHUP handling in $(PROGRAM_NAME)."
@echo " -DNO_VERSION_INFORMATION Don't support displaying version information in $(PROGRAM_NAME) and $(CLIENT_NAME). Removes -V option."
@echo " -DENABLE_DEPRECATED_OPTIONS Enable command line options that provide compatibility with previous versions of $(PROGRAM_NAME)."
@echo "" @echo ""
@echo "Troubleshooting options" @echo "Troubleshooting options"
@echo " CAT=1 Combine all sources in a single file." @echo " CAT=1 Combine all sources in a single in-memory file and compile directly to target."
@echo " CAT=2 Combine all sources in a single file and don't create a *.o file."
@echo " NOPROCFS=1 Don't rely on a properly mounted proc filesystem in /proc." @echo " NOPROCFS=1 Don't rely on a properly mounted proc filesystem in /proc."
@echo " AUXV=1 Use /proc/self/auxv (requires Linux with glibc >= 2.16 or musl.)" @echo " AUXV=1 Use /proc/self/auxv (requires Linux with glibc >= 2.16 or musl.)"
@echo " NOLPTHREAD=1 Disable detection if -lpthread is required (for use with Android NDK)." @echo " NOLPTHREAD=1 Disable detection if -lpthread is required (for use with Android NDK)."
@echo " NOLRESOLV=1 Disable detection if -lresolv is requires (for use with Android NDK)." @echo " NOLRESOLV=1 Disable detection if -lresolv is required (for use with Android NDK)."
@echo " NOLIBS=1 Do not attempt to autodetect any library dependencies." @echo " NOLIBS=1 Do not attempt to autodetect any library dependencies."
@echo " OPENSSL_HMAC=0 Compile for openssl versions that don't have HMAC support (required on some embedded devices)." @echo " OPENSSL_HMAC=0 Compile for openssl versions that don't have HMAC support (required on some embedded devices)."
@echo " NO_TIMEOUT=1 Do not set timeouts for sockets (for systems that don't support it)." @echo " NO_TIMEOUT=1 Do not set timeouts for sockets (for systems that don't support it)."
@echo " CHILD_HANDLER=1 Install a handler for SIGCHLD (for systems that don't support SA_NOCLDWAIT)." @echo " CHILD_HANDLER=1 Install a handler for SIGCHLD (for systems that don't support SA_NOCLDWAIT)."
@echo " NO_DNS=1 Compile vlmcs without support for detecting KMS servers via DNS." @echo " NO_DNS=1 Compile $(CLIENT_NAME) without support for detecting KMS servers via DNS."
@echo " DNS_PARSER=internal Use $(CLIENT_NAME) internal DNS parsing routines. No effect on MingW (native Windows)." @echo " DNS_PARSER=internal Use $(CLIENT_NAME) internal DNS parsing routines. No effect on MingW (native Windows)."
@echo "" @echo ""
@echo "Other useful CFLAGS:" @echo "Other useful CFLAGS"
@echo " -DSUPPORT_WINE Add code that the Windows version of $(PROGRAM_NAME) runs on Wine if MSRPC=1" @echo " -DSUPPORT_WINE Add code that the Windows version of $(PROGRAM_NAME) runs on Wine if MSRPC=1"
@echo " -D_PEDANTIC Report rare error/warning conditions instead of silently ignoring them." @echo " -D_PEDANTIC Report rare error/warning conditions instead of silently ignoring them."
@echo " -DINCLUDE_BETAS Include SKU / activation IDs for obsolete beta/preview products." @echo " -DINCLUDE_BETAS Include SKU / activation IDs for obsolete beta/preview products."

View File

@ -37,15 +37,15 @@
*/ */
#ifndef EPID_WINDOWS #ifndef EPID_WINDOWS
#define EPID_WINDOWS "06401-00206-271-298329-03-1033-9600.0000-0452015" #define EPID_WINDOWS "06401-00206-271-398432-03-1033-9600.0000-1422016"
#endif #endif
#ifndef EPID_OFFICE2010 #ifndef EPID_OFFICE2010
#define EPID_OFFICE2010 "06401-00096-199-198322-03-1033-9600.0000-0452015" #define EPID_OFFICE2010 "06401-00096-199-198384-03-1033-9600.0000-1422016"
#endif #endif
#ifndef EPID_OFFICE2013 #ifndef EPID_OFFICE2013
#define EPID_OFFICE2013 "06401-00206-234-398213-03-1033-9600.0000-0452015" #define EPID_OFFICE2013 "06401-00206-234-384729-03-1033-9600.0000-1422016"
#endif #endif
#ifndef HWID // HwId from the Ratiborus VM #ifndef HWID // HwId from the Ratiborus VM
@ -82,6 +82,25 @@
/*
* -------------------------------
* Backward compatibility
* -------------------------------
*/
#if !defined(ENABLE_DEPRECATED_OPTIONS)
/*
* comment out the following line if you want vlmcsd no to support command line options
* that have been present in previous versions of vlmcsd and are now obsolete
*/
//#define ENABLE_DEPRECATED_OPTIONS
#endif // ENABLE_DEPRECATED_OPTIONS
/* /*
* ---------------------------------------------------------------------------------------- * ----------------------------------------------------------------------------------------
@ -366,6 +385,20 @@
*/ */
#ifndef NO_FREEBIND
/*
* Do not compile support for FREEBIND (Linux) and IP_BINDANY (FreeBSD). This disables the -F1 command
* line option and you can bind only to (listen on) IP addresses that are currently up and running on
* your system.
*/
//#define NO_FREEBIND
#endif // NO_FREEBIND
#ifndef NO_EXTENDED_PRODUCT_LIST #ifndef NO_EXTENDED_PRODUCT_LIST
/* /*
* Do not compile the extended product list. Removes the list of Activation GUIDs (aka * Do not compile the extended product list. Removes the list of Activation GUIDs (aka
@ -399,6 +432,18 @@
#ifndef NO_VERSION_INFORMATION
/*
* Removes the -V option from vlmcsd and vlmcs that displays the version information
*/
//#define NO_VERSION_INFORMATION
#endif // NO_VERSION_INFORMATION
#ifndef NO_VERBOSE_LOG #ifndef NO_VERBOSE_LOG
/* /*
* Removes the ability to do verbose logging and disables -v and -q in vlmcsd. It does not remove the -v * Removes the ability to do verbose logging and disables -v and -q in vlmcsd. It does not remove the -v
@ -577,6 +622,19 @@
#ifndef SIMPLE_SOCKETS
/*
* Disables the ability to choose IP addresses using the -L option in vlmcsd. vlmcsd will listen on all IP addresses.
* It still supports IPv4 and IPv6.
*/
//#define SIMPLE_SOCKETS
#endif // SIMPLE_SOCKETS
/* Don't change anything BELOW this line */ /* Don't change anything BELOW this line */

Binary file not shown.

26
kms.c
View File

@ -51,6 +51,7 @@ const KmsIdList ProductList[] = {
}; };
#endif #endif
#ifndef IS_LIBRARY
// Application ID is used by KMS server to count KeyManagementServiceCurrentCount // Application ID is used by KMS server to count KeyManagementServiceCurrentCount
// Do not change the order of this list. Append items as necessary // Do not change the order of this list. Append items as necessary
const KmsIdList AppList[] = { const KmsIdList AppList[] = {
@ -59,6 +60,7 @@ const KmsIdList AppList[] = {
/* 002 */ { { 0x0FF1CE15, 0xA989, 0x479D, { 0xaf, 0x46, 0xf2, 0x75, 0xc6, 0x37, 0x06, 0x63 } } /*"0FF1CE15-A989-479D-AF46-F275C6370663"*/, FRIENDLY_NAME_OFFICE2013, EPID_OFFICE2013, 0, 0}, /* 002 */ { { 0x0FF1CE15, 0xA989, 0x479D, { 0xaf, 0x46, 0xf2, 0x75, 0xc6, 0x37, 0x06, 0x63 } } /*"0FF1CE15-A989-479D-AF46-F275C6370663"*/, FRIENDLY_NAME_OFFICE2013, EPID_OFFICE2013, 0, 0},
/* 003 */ { { 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, NULL, NULL, 0, 0 } /* 003 */ { { 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, NULL, NULL, 0, 0 }
}; };
#endif // IS_LIBRARY
#ifndef NO_EXTENDED_PRODUCT_LIST #ifndef NO_EXTENDED_PRODUCT_LIST
const KmsIdList ExtendedProductList [] = { const KmsIdList ExtendedProductList [] = {
@ -258,7 +260,7 @@ static const struct KMSHostOS { uint16_t Type; uint16_t Build; } HostOS[] =
{ 55041, 7601 }, // Windows Server 2008 R2 SP1 { 55041, 7601 }, // Windows Server 2008 R2 SP1
{ 5426, 9200 }, // Windows Server 2012 { 5426, 9200 }, // Windows Server 2012
{ 6401, 9600 }, // Windows Server 2012 R2 { 6401, 9600 }, // Windows Server 2012 R2
{ 3612, 10240}, // Windows Server 2016 //{ 3612, 10240}, // Windows Server 2016
}; };
// GroupID and PIDRange // GroupID and PIDRange
@ -377,9 +379,10 @@ static int getRandomServerType()
# ifndef USE_MSRPC # ifndef USE_MSRPC
else else
{ {
// return 9200/9600/10240 if NDR64 is in use, otherwise 6002/7601 // return 9200/9600 if NDR64 is in use, otherwise 6002/7601
if (UseRpcNDR64) return (rand() % 3) + 2; return (rand() % 2) + (UseRpcNDR64 ? 2 : 0);
return (rand() % 2); // if (UseRpcNDR64) return (rand() % 3) + 2;
// return (rand() % 2);
} }
# endif // USE_MSRPC # endif // USE_MSRPC
} }
@ -424,12 +427,12 @@ static void generateRandomPid(const int index, char *const szPid, int serverType
strcat(szPid, itoc(numberBuffer, HostOS[serverType].Build, 0)); strcat(szPid, itoc(numberBuffer, HostOS[serverType].Build, 0));
strcat(szPid, ".0000-"); strcat(szPid, ".0000-");
# define minTime ((time_t)1436958000) // Release Date Windows 10 RTM Escrow # define minTime ((time_t)1382029200) // Release Date Win 2012R2
time_t maxTime, kmsTime; time_t maxTime, kmsTime;
time(&maxTime); time(&maxTime);
if (maxTime < minTime) // Just in case the system time is < 07/15/2015 1:00 pm if (maxTime < (time_t)BUILD_TIME) // Just in case the system time is < 10/17/2013 1:00 pm
maxTime = (time_t)BUILD_TIME; maxTime = (time_t)BUILD_TIME;
kmsTime = (rand32() % (maxTime - minTime)) + minTime; kmsTime = (rand32() % (maxTime - minTime)) + minTime;
@ -519,6 +522,7 @@ static void logRequest(const REQUEST *const baseRequest)
/* /*
* Converts a utf-8 ePID string to UCS-2 and writes it to a RESPONSE struct * Converts a utf-8 ePID string to UCS-2 and writes it to a RESPONSE struct
*/ */
#ifndef IS_LIBRARY
static void getEpidFromString(RESPONSE *const Response, const char *const pid) static void getEpidFromString(RESPONSE *const Response, const char *const pid)
{ {
size_t length = utf8_to_ucs2(Response->KmsPID, pid, PID_BUFFER_SIZE, PID_BUFFER_SIZE * 3); size_t length = utf8_to_ucs2(Response->KmsPID, pid, PID_BUFFER_SIZE, PID_BUFFER_SIZE * 3);
@ -567,6 +571,7 @@ static void getEpid(RESPONSE *const baseResponse, const char** EpidSource, const
} }
getEpidFromString(baseResponse, pid); getEpidFromString(baseResponse, pid);
} }
#endif // IS_LIBRARY
#if !defined(NO_LOG) && defined(_PEDANTIC) #if !defined(NO_LOG) && defined(_PEDANTIC)
@ -627,6 +632,7 @@ static void logResponse(const RESPONSE *const baseResponse, const BYTE *const hw
/* /*
* Creates the unencrypted base response * Creates the unencrypted base response
*/ */
#ifndef IS_LIBRARY
static BOOL __stdcall CreateResponseBaseCallback(const REQUEST *const baseRequest, RESPONSE *const baseResponse, BYTE *const hwId, const char* const ipstr) static BOOL __stdcall CreateResponseBaseCallback(const REQUEST *const baseRequest, RESPONSE *const baseResponse, BYTE *const hwId, const char* const ipstr)
{ {
const char* EpidSource; const char* EpidSource;
@ -663,6 +669,13 @@ static BOOL __stdcall CreateResponseBaseCallback(const REQUEST *const baseReques
RequestCallback_t CreateResponseBase = &CreateResponseBaseCallback; RequestCallback_t CreateResponseBase = &CreateResponseBaseCallback;
#else // IS_LIBRARY
RequestCallback_t CreateResponseBase = NULL;
#endif // IS_LIBRARY
////TODO: Move to helpers.c ////TODO: Move to helpers.c
void get16RandomBytes(void* ptr) void get16RandomBytes(void* ptr)
{ {
@ -670,7 +683,6 @@ void get16RandomBytes(void* ptr)
for (i = 0; i < 4; i++) ((DWORD*)ptr)[i] = rand32(); for (i = 0; i < 4; i++) ((DWORD*)ptr)[i] = rand32();
} }
/* /*
* Creates v4 response * Creates v4 response
*/ */

View File

@ -29,7 +29,14 @@ __stdcall BOOL KmsCallBack(const REQUEST *const baseRequest, RESPONSE *const bas
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
printf("libvlmcs-test.c: Program start\n"); int version = GetLibKmsVersion();
if (version < 0x30001)
{
fprintf(stderr, "KMS library version %u.%u or greater required\n", (unsigned int)(version >> 16), (unsigned int)(version & 0xffff));
}
printf("%s: Program start\n", GetEmulatorVersion());
StartKmsServer(1688, KmsCallBack); StartKmsServer(1688, KmsCallBack);
return 0; return 0;
} }

View File

@ -7,9 +7,13 @@
#endif // CONFIG #endif // CONFIG
#include CONFIG #include CONFIG
#ifdef EXTERNAL
#undef EXTERNAL
#endif
#define EXTERNAL dllexport #define EXTERNAL dllexport
#define DLLVERSION 0x30000 #define DLLVERSION 0x30001
#include "libkms.h" #include "libkms.h"
#include "shared_globals.h" #include "shared_globals.h"
@ -24,6 +28,10 @@
#include <netinet/in.h> #include <netinet/in.h>
#endif // WIN32 #endif // WIN32
#ifdef IS_LIBRARY
char ErrorMessage[MESSAGE_BUFFER_SIZE];
#endif // IS_LIBRARY
static int_fast8_t IsServerStarted = FALSE; static int_fast8_t IsServerStarted = FALSE;
@ -42,6 +50,7 @@ EXTERNC __declspec(EXTERNAL) DWORD __cdecl SendActivationRequest
EXTERNC __declspec(EXTERNAL) DWORD __cdecl StartKmsServer(const int port, RequestCallback_t requestCallback) EXTERNC __declspec(EXTERNAL) DWORD __cdecl StartKmsServer(const int port, RequestCallback_t requestCallback)
{ {
#ifndef SIMPLE_SOCKETS
char listenAddress[64]; char listenAddress[64];
if (IsServerStarted) return !0; if (IsServerStarted) return !0;
@ -97,6 +106,39 @@ EXTERNC __declspec(EXTERNAL) DWORD __cdecl StartKmsServer(const int port, Reques
IsServerStarted = FALSE; IsServerStarted = FALSE;
return 0; return 0;
# else // SIMPLE_SOCKETS
if (IsServerStarted) return !0;
int error;
# ifdef _WIN32
# ifndef USE_MSRPC
// Windows Sockets must be initialized
WSADATA wsadata;
if ((error = WSAStartup(0x0202, &wsadata)))
{
return error;
}
# endif // USE_MSRPC
# endif // _WIN32
defaultport = vlmcsd_malloc(16);
snprintf((char*)defaultport, (size_t)16, "%i", port);
CreateResponseBase = requestCallback;
error = listenOnAllAddresses();
if (error) return error;
IsServerStarted = TRUE;
runServer();
IsServerStarted = FALSE;
return 0;
# endif // SIMPLE_SOCKETS
} }
@ -105,7 +147,11 @@ EXTERNC __declspec(EXTERNAL) DWORD __cdecl StopKmsServer()
if (!IsServerStarted) return !0; if (!IsServerStarted) return !0;
closeAllListeningSockets(); closeAllListeningSockets();
# ifndef SIMPLE_SOCKETS
if (SocketList) free(SocketList); if (SocketList) free(SocketList);
# endif
return 0; return 0;
} }
@ -115,3 +161,9 @@ EXTERNC __declspec(EXTERNAL) int __cdecl GetLibKmsVersion()
return DLLVERSION; return DLLVERSION;
} }
EXTERNC __declspec(EXTERNAL) const char* const __cdecl GetEmulatorVersion()
{
return VERSION;
}

View File

@ -9,24 +9,19 @@
#include "kms.h" #include "kms.h"
#include "rpc.h" #include "rpc.h"
#ifndef EXTERNC
#ifdef __cplusplus #ifdef __cplusplus
#define EXTERNC extern "C" #define EXTERNC EXTERN "C"
#else #else
#define EXTERNC #define EXTERNC
#endif #endif
#if !defined(_WIN32) && !__CYGWIN__
#define __declspec(x) __attribute__((__visibility__("default")))
#endif
#if !defined(EXTERNAL)
#define EXTERNAL dllimport
#endif #endif
EXTERNC __declspec(EXTERNAL) DWORD __cdecl SendActivationRequest(const char* const hostname, const int port, RESPONSE* baseResponse, const REQUEST* const baseRequest, RESPONSE_RESULT* result, BYTE *hwid); EXTERNC __declspec(EXTERNAL) DWORD __cdecl SendActivationRequest(const char* const hostname, const int port, RESPONSE* baseResponse, const REQUEST* const baseRequest, RESPONSE_RESULT* result, BYTE *hwid);
EXTERNC __declspec(EXTERNAL) DWORD __cdecl StartKmsServer(const int port, RequestCallback_t requestCallback); EXTERNC __declspec(EXTERNAL) DWORD __cdecl StartKmsServer(const int port, RequestCallback_t requestCallback);
EXTERNC __declspec(EXTERNAL) DWORD __cdecl StopKmsServer(); EXTERNC __declspec(EXTERNAL) DWORD __cdecl StopKmsServer();
EXTERNC __declspec(EXTERNAL) int __cdecl GetLibKmsVersion(); EXTERNC __declspec(EXTERNAL) int __cdecl GetLibKmsVersion();
EXTERNC __declspec(EXTERNAL) const char* const __cdecl GetEmulatorVersion();
//EXTERN_C __declspec(EXTERNAL) unsigned int __cdecl GetRandom32(); //EXTERN_C __declspec(EXTERNAL) unsigned int __cdecl GetRandom32();

View File

@ -14,6 +14,7 @@ CF45="-static-libgcc -pipe -fno-common -fno-exceptions -fno-stack-protector -fno
CFCLANG="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants" CFCLANG="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
LF="-Wl,-z,norelro -Wl,--hash-style=sysv -Wl,--build-id=none" LF="-Wl,-z,norelro -Wl,--hash-style=sysv -Wl,--build-id=none"
LFCLANG="-Wl,-z,norelro -Wl,--hash-style=sysv" LFCLANG="-Wl,-z,norelro -Wl,--hash-style=sysv"
export CC=gcc5
gmake $MAKEFLAGS PROGRAM_NAME=vlmcsd-DragonFly-x64 CLIENT_NAME=vlmcs-DragonFly-x64 CFLAGS="$CF" LDFLAGS="$LF" gmake $MAKEFLAGS PROGRAM_NAME=vlmcsd-DragonFly-x64 CLIENT_NAME=vlmcs-DragonFly-x64 CFLAGS="$CF" LDFLAGS="$LF"
rm vlmcsd.o vlmcs.o rm vlmcsd.o vlmcs.o

View File

@ -14,33 +14,33 @@ CFCLANG="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tabl
LF="-Wl,-z,norelro -Wl,--hash-style=gnu -Wl,--build-id=none" LF="-Wl,-z,norelro -Wl,--hash-style=gnu -Wl,--build-id=none"
LFCLANG="-Wl,-z,norelro -Wl,--hash-style=gnu" LFCLANG="-Wl,-z,norelro -Wl,--hash-style=gnu"
gmake $MAKEFLAGS allmulti CAT=2 MULTI_NAME=vlmcsdmulti-FreeBSD-10.2-x64-gcc CLIENT_NAME=vlmcs-FreeBSD-10.2-x64-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x64-gcc CC=gcc5 CFLAGS="$CF" LDFLAGS="$LF" gmake $MAKEFLAGS allmulti CAT=2 MULTI_NAME=vlmcsdmulti-FreeBSD-10.3-x64-gcc CLIENT_NAME=vlmcs-FreeBSD-10.3-x64-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x64-gcc CC=gcc5 CFLAGS="$CF" LDFLAGS="$LF"
gmake $MAKEFLAGS CLIENT_NAME=vlmcs-FreeBSD-10.2-x64 PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x64 CC=clang36 CFLAGS="$CFCLANG" LDFLAGS="$LF" gmake $MAKEFLAGS CLIENT_NAME=vlmcs-FreeBSD-10.3-x64 PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x64 CC=clang38 CFLAGS="$CFCLANG" LDFLAGS="$LF"
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.*
gmake $REUSEOBJFLAGS vlmcsdmulti-FreeBSD-10.2-x64 MULTI_NAME=vlmcsdmulti-FreeBSD-10.2-x64 CC=clang36 CFLAGS="$CFCLANG" LDFLAGS="$LF" gmake $REUSEOBJFLAGS vlmcsdmulti-FreeBSD-10.3-x64 MULTI_NAME=vlmcsdmulti-FreeBSD-10.3-x64 CC=clang38 CFLAGS="$CFCLANG" LDFLAGS="$LF"
gmake $MAKEFLAGS CLIENT_NAME=vlmcs-FreeBSD-10.2-x86 PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x86 CC=clang36 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF" gmake $MAKEFLAGS CLIENT_NAME=vlmcs-FreeBSD-10.3-x86 PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x86 CC=clang38 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.*
gmake $REUSEOBJFLAGS vlmcsdmulti-FreeBSD-10.2-x86 MULTI_NAME=vlmcsdmulti-FreeBSD-10.2-x86 CC=clang36 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF" gmake $REUSEOBJFLAGS vlmcsdmulti-FreeBSD-10.3-x86 MULTI_NAME=vlmcsdmulti-FreeBSD-10.3-x86 CC=clang38 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
gmake $MAKEFLAGS allmulti CAT=2 MULTI_NAME=vlmcsdmulti-FreeBSD-10.2-x86-gcc CLIENT_NAME=vlmcs-FreeBSD-10.2-x86-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x86-gcc CC=gcc5 CFLAGS="$CF -m32 -DCOMPAT_32BIT" LDFLAGS="-L/usr/lib32 -B/usr/lib32 $LF" gmake $MAKEFLAGS allmulti CAT=2 MULTI_NAME=vlmcsdmulti-FreeBSD-10.3-x86-gcc CLIENT_NAME=vlmcs-FreeBSD-10.3-x86-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x86-gcc CC=gcc5 CFLAGS="$CF -m32 -DCOMPAT_32BIT" LDFLAGS="-L/usr/lib32 -B/usr/lib32 $LF"
gmake $MAKEFLAGS CAT=2 vlmcsd-FreeBSD-10.2-x64-threads-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x64-threads-gcc THREADS=1 CC=gcc5 CFLAGS="$CF" LDFLAGS="-lpthread $LF" gmake $MAKEFLAGS CAT=2 vlmcsd-FreeBSD-10.3-x64-threads-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x64-threads-gcc THREADS=1 CC=gcc5 CFLAGS="$CF" LDFLAGS="-lpthread $LF"
gmake $MAKEFLAGS vlmcsd-FreeBSD-10.2-x64-threads PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x64-threads THREADS=1 CC=clang36 CFLAGS="$CFCLANG" LDFLAGS="-lpthread $LF" gmake $MAKEFLAGS vlmcsd-FreeBSD-10.3-x64-threads PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x64-threads THREADS=1 CC=clang38 CFLAGS="$CFCLANG" LDFLAGS="-lpthread $LF"
gmake $MAKEFLAGS vlmcsd-FreeBSD-10.2-x86-threads PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x86-threads THREADS=1 CC=clang36 CFLAGS="$CFCLANG -m32" LDFLAGS="-lpthread $LF" gmake $MAKEFLAGS vlmcsd-FreeBSD-10.3-x86-threads PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x86-threads THREADS=1 CC=clang38 CFLAGS="$CFCLANG -m32" LDFLAGS="-lpthread $LF"
gmake $MAKEFLAGS CAT=2 vlmcsd-FreeBSD-10.2-x86-threads-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x86-threads-gcc THREADS=1 CC=gcc5 CFLAGS="$CF -m32 -DCOMPAT_32BIT" LDFLAGS="-lpthread -L/usr/lib32 -B/usr/lib32 $LF" gmake $MAKEFLAGS CAT=2 vlmcsd-FreeBSD-10.3-x86-threads-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x86-threads-gcc THREADS=1 CC=gcc5 CFLAGS="$CF -m32 -DCOMPAT_32BIT" LDFLAGS="-lpthread -L/usr/lib32 -B/usr/lib32 $LF"
gmake $MAKEFLAGS CRYPTO=openssl_with_aes CLIENT_NAME=vlmcs-FreeBSD-10.2-x64-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x64-openssl1.0.1-EXPERIMENTAL CC=clang36 CFLAGS="$CFCLANG" LDFLAGS="$LF" gmake $MAKEFLAGS CRYPTO=openssl_with_aes CLIENT_NAME=vlmcs-FreeBSD-10.3-x64-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x64-openssl1.0.1-EXPERIMENTAL CC=clang38 CFLAGS="$CFCLANG" LDFLAGS="$LF"
gmake $MAKEFLAGS CRYPTO=openssl_with_aes CLIENT_NAME=vlmcs-FreeBSD-10.2-x86-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=vlmcsd-FreeBSD-10.2-x86-openssl1.0.1-EXPERIMENTAL CC=clang36 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF" gmake $MAKEFLAGS CRYPTO=openssl_with_aes CLIENT_NAME=vlmcs-FreeBSD-10.3-x86-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=vlmcsd-FreeBSD-10.3-x86-openssl1.0.1-EXPERIMENTAL CC=clang38 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
rm *.o rm *.o
strip -s --strip-unneeded --remove-section=.eh_frame_hdr --remove-section=.eh_frame --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag vlmcs-* vlmcsd-* vlmcsdmulti-* strip -s --strip-unneeded --remove-section=.eh_frame_hdr --remove-section=.eh_frame --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag vlmcs-* vlmcsd-* vlmcsdmulti-*
sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-* sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-*
sudo cp -af vlmcsd-FreeBSD-10.2-x86-gcc /usr/local/sbin/vlmcsd sudo cp -af vlmcsd-FreeBSD-10.3-x86-gcc /usr/local/sbin/vlmcsd
sudo cp -af vlmcs-FreeBSD-10.2-x86-gcc /usr/local/bin/vlmcs sudo cp -af vlmcs-FreeBSD-10.3-x86-gcc /usr/local/bin/vlmcs
# Copy everything to distribution server # Copy everything to distribution server
scp -p vlmcsdmulti-* vlmcsd-* vlmcs-* root@ubuntu64:x/binaries/FreeBSD/intel/ scp -p vlmcsdmulti-* vlmcsd-* vlmcs-* root@ubuntu64:x/binaries/FreeBSD/intel/

38
make_hurd Executable file
View File

@ -0,0 +1,38 @@
#!/bin/bash
export VERBOSE=3
export DNS_PARSER=OS
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
MAKEFLAGS="-B -j1"
export CC=gcc
CF="-flto=jobserver -pipe -fwhole-program -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
LF="-fuse-ld=gold -lresolv -Wl,-z,norelro,--hash-style=gnu,--build-id=none"
make $MAKEFLAGS PROGRAM_NAME=vlmcsd-hurd-x86-glibc CLIENT_NAME=vlmcs-hurd-x86-glibc CFLAGS="$CF" LDFLAGS="$LF" CAT=2
make $MAKEFLAGS MULTI_NAME=vlmcsdmulti-hurd-x86-glibc vlmcsdmulti-hurd-x86-glibc CFLAGS="$CF" LDFLAGS="$LF" CAT=2 AUXV=1
make clean
sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-*
cp -af vlmcsd-hurd-x86-glibc /usr/local/sbin/vlmcsd
cp -af vlmcs-hurd-x86-glibc /usr/local/bin/vlmcs
# Copy man pages
mkdir -p /usr/local/man/man1 2>/dev/null
mkdir -p /usr/local/man/man5 2>/dev/null
mkdir -p /usr/local/man/man8 2>/dev/null
mkdir -p /usr/local/man/man7 2>/dev/null
cp -af vlmcs.1 vlmcsdmulti.1 /usr/local/man/man1/
cp -af vlmcsd.7 /usr/local/man/man7/
cp -af vlmcsd.8 /usr/local/man/man8/
cp -af vlmcsd.ini.5 /usr/local/man/man5/
bzip2 -f -9 /usr/local/man/man5/vlmcsd.ini.5 /usr/local/man/man1/vlmcs.1 /usr/local/man/man1/vlmcsdmulti.1 /usr/local/man/man7/vlmcsd.7 /usr/local/man/man8/vlmcsd.8
# Copy everything to distribution server
scp -p vlmcsdmulti-* vlmcsd-* vlmcs-* root@ubuntu64.internal:x/binaries/Hurd/intel/

47
make_kfreebsd Executable file
View File

@ -0,0 +1,47 @@
#!/bin/bash
export VERBOSE=3
export DNS_PARSER=OS
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
MAKEFLAGS="-B -j`nproc`"
export CC=gcc
CF="-flto=jobserver -pipe -fwhole-program -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
LF="-lresolv -Wl,-z,norelro,--hash-style=gnu,--build-id=none"
export PROGRAM_NAME=vlmcsd-FreeBSD-10.1-x64-glibc
export CLIENT_NAME=vlmcs-FreeBSD-10.1-x64-glibc
export MULTI_NAME=vlmcsdmulti-FreeBSD-10.1-x64-glibc
make $MAKEFLAGS CFLAGS="$CF -m64" LDFLAGS="$LF" CAT=2
make $MAKEFLAGS $MULTI_NAME CFLAGS="$CF -m64" LDFLAGS="$LF" CAT=2 AUXV=1
export PROGRAM_NAME=vlmcsd-FreeBSD-10.1-x86-glibc
export CLIENT_NAME=vlmcs-FreeBSD-10.1-x86-glibc
export MULTI_NAME=vlmcsdmulti-FreeBSD-10.1-x86-glibc
make $MAKEFLAGS CFLAGS="$CF -m32" LDFLAGS="$LF" CAT=2
make $MAKEFLAGS $MULTI_NAME CFLAGS="$CF -m32" LDFLAGS="$LF" CAT=2 AUXV=1
sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-*
cp -af $PROGRAM_NAME /usr/local/sbin/vlmcsd
cp -af $CLIENT_NAME /usr/local/bin/vlmcs
# Copy man pages
mkdir -p /usr/local/man/man1 2>/dev/null
mkdir -p /usr/local/man/man5 2>/dev/null
mkdir -p /usr/local/man/man8 2>/dev/null
mkdir -p /usr/local/man/man7 2>/dev/null
cp -af vlmcs.1 vlmcsdmulti.1 /usr/local/man/man1/
cp -af vlmcsd.7 /usr/local/man/man7/
cp -af vlmcsd.8 /usr/local/man/man8/
cp -af vlmcsd.ini.5 /usr/local/man/man5/
bzip2 -f -9 /usr/local/man/man5/vlmcsd.ini.5 /usr/local/man/man1/vlmcs.1 /usr/local/man/man1/vlmcsdmulti.1 /usr/local/man/man7/vlmcsd.7 /usr/local/man/man8/vlmcsd.8
# Copy everything to distribution server
scp -p vlmcsdmulti-* vlmcsd-* vlmcs-* root@ubuntu64.internal:x/binaries/FreeBSD/intel/

View File

@ -20,7 +20,7 @@ mkdir -p binaries/Linux/intel/uclibc
mkdir -p binaries/Linux/intel/static mkdir -p binaries/Linux/intel/static
mkdir -p binaries/Linux/intel/musl mkdir -p binaries/Linux/intel/musl
mkdir -p binaries/Linux/sparc32/glibc mkdir -p binaries/Linux/sparc/glibc
mkdir -p binaries/Linux/s390/glibc mkdir -p binaries/Linux/s390/glibc
mkdir -p binaries/Android/arm/bionic mkdir -p binaries/Android/arm/bionic
@ -62,10 +62,13 @@ mkdir -p binaries/DragonFly/intel
mkdir -p binaries/Solaris/intel mkdir -p binaries/Solaris/intel
mkdir -p binaries/Windows/intel mkdir -p binaries/Windows/intel
mkdir -p binaries/Minix/intel mkdir -p binaries/Minix/intel
mkdir -p binaries/Hurd/intel
rm -f *_all.c vlmcsd.o vlmcs.o vlmcsdmulti.o 2> /dev/null rm -f *_all.c vlmcsd.o vlmcs.o vlmcsdmulti.o 2> /dev/null
export STAGING_DIR=. export STAGING_DIR=.
# Windows 32-bit using MingW32-w64 toolchain on Ubuntu Linux # Windows 32-bit using MingW32-w64 toolchain on Ubuntu Linux
export CLIENT_NAME=binaries/Windows/intel/vlmcs-Windows-x86.exe export CLIENT_NAME=binaries/Windows/intel/vlmcs-Windows-x86.exe
export PROGRAM_NAME=binaries/Windows/intel/vlmcsd-Windows-x86.exe export PROGRAM_NAME=binaries/Windows/intel/vlmcsd-Windows-x86.exe
@ -75,10 +78,10 @@ export THREADS=1
export CFLAGS="$SMALLCC" export CFLAGS="$SMALLCC"
export CC=i686-w64-mingw32-gcc export CC=i686-w64-mingw32-gcc
export PLATFORMFLAGS="-march=i686 -mtune=generic -fwhole-program -pipe" export PLATFORMFLAGS="-march=i686 -mtune=generic -fwhole-program -pipe"
export LDFLAGS="-lws2_32 -Wl,--gc-sections,--force-exe-suffix,--large-address-aware,--nxcompat,--dynamicbase,--tsaware" export LDFLAGS="-lws2_32 -Wl,--gc-sections,--force-exe-suffix,--large-address-aware,--nxcompat,--dynamicbase,--tsaware,--no-seh,--disable-long-section-names"
export FEATURES=full export FEATURES=full
make $MAKEFLAGS CAT=2 all $MULTI_NAME make $MAKEFLAGS CRYPTO=windows CAT=2 all $MULTI_NAME
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME, $MULTI_NAME and/or $PROGRAM_NAME echo Error creating $CLIENT_NAME, $MULTI_NAME and/or $PROGRAM_NAME
@ -88,7 +91,7 @@ fi
export CFLAGS="$CFLAGS -flto=jobserver -fvisibility=hidden" export CFLAGS="$CFLAGS -flto=jobserver -fvisibility=hidden"
export LDFLAGS="$LDFLAGS -static-libgcc" export LDFLAGS="$LDFLAGS -static-libgcc"
make $MAKEFLAGS FEATURES=minimum $DLL_NAME make $MAKEFLAGS CRYPTO=windows FEATURES=minimum $DLL_NAME
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $DLL_NAME echo Error creating $DLL_NAME
@ -105,17 +108,28 @@ export THREADS=1
export CFLAGS="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fmerge-all-constants -Wno-unused-variable -Wno-missing-braces" export CFLAGS="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fmerge-all-constants -Wno-unused-variable -Wno-missing-braces"
export CC=i686-w64-mingw32-gcc export CC=i686-w64-mingw32-gcc
export PLATFORMFLAGS="-march=i686 -mtune=generic -pipe" export PLATFORMFLAGS="-march=i686 -mtune=generic -pipe"
export LDFLAGS="-Wl,--gc-sections,--force-exe-suffix,--large-address-aware,--nxcompat,--dynamicbase,--tsaware -fwhole-program" export LDFLAGS="-Wl,--gc-sections,--force-exe-suffix,--large-address-aware,--nxcompat,--dynamicbase,--tsaware,--disable-long-section-names -fwhole-program"
export FEATURES=full export FEATURES=full
make $MAKEFLAGS CAT=2 MSRPC=1 all make $MAKEFLAGS CAT=2 MSRPC=1 CRYPTO=windows $CLIENT_NAME
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME and/or $PROGRAM_NAME echo Error creating $CLIENT_NAME
exit $? exit $?
fi fi
make $MAKEFLAGS MSRPC=1 $MULTI_NAME export LDFLAGS="-Wl,--gc-sections,--force-exe-suffix,--large-address-aware,--nxcompat,--dynamicbase,--tsaware,--disable-long-section-names,--no-seh -fwhole-program"
make $MAKEFLAGS CAT=2 MSRPC=1 CRYPTO=windows $PROGRAM_NAME
if [ $? != 0 ]; then
echo Error creating $PROGRAM_NAME
exit $?
fi
export LDFLAGS="-Wl,--gc-sections,--force-exe-suffix,--large-address-aware,--nxcompat,--dynamicbase,--tsaware,--disable-long-section-names -fwhole-program"
make $MAKEFLAGS MSRPC=1 CRYPTO=windows $MULTI_NAME
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $MULTI_NAME echo Error creating $MULTI_NAME
@ -133,9 +147,9 @@ export THREADS=1
export CFLAGS="$SMALLCC" export CFLAGS="$SMALLCC"
export CC=x86_64-w64-mingw32-gcc export CC=x86_64-w64-mingw32-gcc
export PLATFORMFLAGS="-march=nocona -mtune=generic -fwhole-program -pipe" export PLATFORMFLAGS="-march=nocona -mtune=generic -fwhole-program -pipe"
export LDFLAGS="-lws2_32 -Wl,--gc-sections,--force-exe-suffix,--nxcompat,--dynamicbase,--tsaware" export LDFLAGS="-lws2_32 -Wl,--gc-sections,--force-exe-suffix,--nxcompat,--dynamicbase,--tsaware,--no-seh,--high-entropy-va,--disable-long-section-names"
make $MAKEFLAGS CAT=2 all $MULTI_NAME make $MAKEFLAGS CAT=2 CRYPTO=windows all $MULTI_NAME
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME, $MULTI_NAME and/or $PROGRAM_NAME echo Error creating $CLIENT_NAME, $MULTI_NAME and/or $PROGRAM_NAME
@ -145,7 +159,7 @@ fi
export CFLAGS="$CFLAGS -flto=jobserver -fvisibility=hidden" export CFLAGS="$CFLAGS -flto=jobserver -fvisibility=hidden"
export LDFLAGS="$LDFLAGS -static-libgcc" export LDFLAGS="$LDFLAGS -static-libgcc"
make $MAKEFLAGS FEATURES=minimum $DLL_NAME make $MAKEFLAGS CRYPTO=windows FEATURES=minimum $DLL_NAME
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $DLL_NAME echo Error creating $DLL_NAME
@ -163,22 +177,85 @@ export THREADS=1
export CFLAGS="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fmerge-all-constants -Wno-unused-variable -Wno-missing-braces" export CFLAGS="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fmerge-all-constants -Wno-unused-variable -Wno-missing-braces"
export CC=x86_64-w64-mingw32-gcc export CC=x86_64-w64-mingw32-gcc
export PLATFORMFLAGS="-march=nocona -mtune=generic -pipe" export PLATFORMFLAGS="-march=nocona -mtune=generic -pipe"
export LDFLAGS="-Wl,--gc-sections,--force-exe-suffix,--nxcompat,--dynamicbase,--tsaware -fwhole-program" export LDFLAGS="-Wl,--gc-sections,--force-exe-suffix,--nxcompat,--dynamicbase,--tsaware,--high-entropy-va,--disable-long-section-names -fwhole-program"
make $MAKEFLAGS CAT=2 MSRPC=1 all make $MAKEFLAGS CAT=2 CRYPTO=windows MSRPC=1 $CLIENT_NAME
if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME
exit $?
fi
export LDFLAGS="-Wl,--gc-sections,--force-exe-suffix,--nxcompat,--dynamicbase,--tsaware,--no-seh,--high-entropy-va,--disable-long-section-names -fwhole-program"
make $MAKEFLAGS CAT=2 CRYPTO=windows MSRPC=1 $PROGRAM_NAME
if [ $? != 0 ]; then
echo Error creating $PROGRAM_NAME
exit $?
fi
export LDFLAGS="-Wl,--gc-sections,--force-exe-suffix,--nxcompat,--dynamicbase,--tsaware,--high-entropy-va,--disable-long-section-names -fwhole-program"
export PLATFORMFLAGS="-march=nocona -mtune=generic -pipe -flto=jobserver"
make $MAKEFLAGS MSRPC=1 CRYPTO=windows $MULTI_NAME
if [ $? != 0 ]; then
echo Error creating $MULTI_NAME
exit $?
fi
# mips1el uclibc with old tomato toolchain gcc 3.2.3 with Broadcom extensions uClibc 0.9.19
export CLIENT_NAME=binaries/Linux/mips/little-endian/uclibc/vlmcs-mips1el-tomato-uclibc
export PROGRAM_NAME=binaries/Linux/mips/little-endian/uclibc/vlmcsd-mips1el-tomato-uclibc
export MULTI_NAME=binaries/Linux/mips/little-endian/uclibc/vlmcsdmulti-mips1el-tomato-uclibc
export CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
export CFLAGS="-DNO_BUILTIN -DNO_LIMIT -pipe -fno-common -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
export PLATFORMFLAGS=""
export LDFLAGS="-fwhole-program -Wl,-z,norelro"
export THREADS=0
#export TERMINAL_WIDTH=80
make $MAKEFLAGS NO_DNS=1 SAFE_MODE=1
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME and/or $PROGRAM_NAME echo Error creating $CLIENT_NAME and/or $PROGRAM_NAME
exit $? exit $?
fi fi
make $MAKEFLAGS MSRPC=1 $MULTI_NAME rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o
make NO_DNS=1 SAFE_MODE=1 $REUSEOBJFLAGS $MULTI_NAME
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $MULTI_NAME echo Error creating $MULTI_NAME
exit $? exit $?
fi fi
export CLIENT_NAME=binaries/Linux/mips/little-endian/static/vlmcs-mips1el-tomato-uclibc-static
export PROGRAM_NAME=binaries/Linux/mips/little-endian/static/vlmcsd-mips1el-tomato-uclibc-static
export MULTI_NAME=binaries/Linux/mips/little-endian/static/vlmcsdmulti-mips1el-tomato-uclibc-static
export LDFLAGS="$LDFLAGS -static"
make NO_DNS=1 SAFE_MODE=1 $REUSEOBJFLAGS $MULTI_NAME
if [ $? != 0 ]; then
echo Error creating $MULTI_NAME
exit $?
fi
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o
make NO_DNS=1 SAFE_MODE=1 $REUSEOBJFLAGS
if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME and/or $PROGRAM_NAME
exit $?
fi
@ -539,40 +616,6 @@ fi
# mips1el uclibc with old tomato toolchain gcc 3.2.3 with Broadcom extensions uClibc 0.9.19
export CLIENT_NAME=binaries/Linux/mips/little-endian/uclibc/vlmcs-mips1el-tomato-uclibc
export PROGRAM_NAME=binaries/Linux/mips/little-endian/uclibc/vlmcsd-mips1el-tomato-uclibc
export MULTI_NAME=binaries/Linux/mips/little-endian/uclibc/vlmcsdmulti-mips1el-tomato-uclibc
export CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
export CFLAGS="-DNO_BUILTIN -pipe -fno-common -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
export PLATFORMFLAGS=""
export LDFLAGS="-pipe -Wl,-z,norelro"
export THREADS=0
#export TERMINAL_WIDTH=80
make NO_DNS=1 CAT=2 $MAKEFLAGS $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME, $MULTI_NAME and/or $PROGRAM_NAME
exit $?
fi
export CLIENT_NAME=binaries/Linux/mips/little-endian/static/vlmcs-mips1el-tomato-uclibc-static
export PROGRAM_NAME=binaries/Linux/mips/little-endian/static/vlmcsd-mips1el-tomato-uclibc-static
export MULTI_NAME=binaries/Linux/mips/little-endian/static/vlmcsdmulti-mips1el-tomato-uclibc-static
export LDFLAGS="$LDFLAGS -static"
make NO_DNS=1 $REUSEOBJFLAGS $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME CAT=2
if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME, $MULTI_NAME and/or $PROGRAM_NAME
exit $?
fi
#Android gcc 4.8 with API Level 3 (Android 1.5 cupcake) armv7 #Android gcc 4.8 with API Level 3 (Android 1.5 cupcake) armv7
export CLIENT_NAME=binaries/Android/arm/bionic/vlmcs-android15-armv7 export CLIENT_NAME=binaries/Android/arm/bionic/vlmcs-android15-armv7
@ -1616,7 +1659,7 @@ export PROGRAM_NAME=binaries/Linux/intel/glibc/vlmcsd-x32-glibc
export CC=gcc export CC=gcc
export CFLAGS="$SMALLCC" export CFLAGS="$SMALLCC"
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mx32 -march=nocona -mtune=generic" export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mx32 -march=nocona -mtune=generic"
export LDFLAGS="$SMALLLD -Wl,--hash-style=gnu" export LDFLAGS="-fuse-ld=gold $SMALLLD -Wl,--hash-style=gnu"
export THREADS=0 export THREADS=0
export NOPROCFS=0 export NOPROCFS=0
export AUXV=1 export AUXV=1
@ -1646,7 +1689,7 @@ export PROGRAM_NAME=binaries/Linux/intel/glibc/vlmcsd-x32-glibc-threads
export CC=gcc export CC=gcc
export CFLAGS="$SMALLCC" export CFLAGS="$SMALLCC"
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mx32 -march=nocona -mtune=generic" export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mx32 -march=nocona -mtune=generic"
export LDFLAGS="$SMALLLD -Wl,--hash-style=gnu -lpthread" export LDFLAGS="-fuse-ld=gold $SMALLLD -Wl,--hash-style=gnu -lpthread"
export THREADS=1 export THREADS=1
export NOPROCFS=0 export NOPROCFS=0
export AUXV=1 export AUXV=1
@ -2121,10 +2164,19 @@ export LDFLAGS="-Wl,-z,norelro -fwhole-program"
export THREADS=0 export THREADS=0
export NOPROCFS=1 export NOPROCFS=1
make $MAKEFLAGS $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME CAT=2 make $MAKEFLAGS SAFE_MODE=1
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME, $MULTI_NAME and/or $PROGRAM_NAME echo Error creating $CLIENT_NAME and/or $PROGRAM_NAME
exit $?
fi
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
make $REUSEOBJFLAGS SAFE_MODE=1 $MULTI_NAME
if [ $? != 0 ]; then
echo Error creating $MULTI_NAME
exit $? exit $?
fi fi
@ -2133,10 +2185,19 @@ export CLIENT_NAME=${INSTALLDIR}static/vlmcs${SUFFIX}-static
export MULTI_NAME=${INSTALLDIR}static/vlmcsdmulti${SUFFIX}-static export MULTI_NAME=${INSTALLDIR}static/vlmcsdmulti${SUFFIX}-static
export LDFLAGS="-Wl,-z,norelro -fwhole-program -static" export LDFLAGS="-Wl,-z,norelro -fwhole-program -static"
make $REUSEOBJFLAGS $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME CAT=2 make $REUSEOBJFLAGS SAFE_MODE=1 $MULTI_NAME
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME, $MULTI_NAME and/or $PROGRAM_NAME echo Error creating $MULTI_NAME
exit $?
fi
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
make $REUSEOBJFLAGS SAFE_MODE=1
if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME and/or $PROGRAM_NAME
exit $? exit $?
fi fi
@ -2226,10 +2287,19 @@ export THREADS=0
export CRYPTO=internal export CRYPTO=internal
export NOPROCFS=1 export NOPROCFS=1
make $MAKEFLAGS CAT=2 $CLIENT_NAME $MULTI_NAME $PROGRAM_NAME make $MAKEFLAGS SAFE_MODE=1
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME, $MULTI_NAME and/or $PROGRAM_NAME echo Error creating $CLIENT_NAME and/or $PROGRAM_NAME
exit $?
fi
rm vlmcsd.o vlmcs.o vlmcsdmulti.o
make $REUSEOBJFLAGS SAFE_MODE=1 $MULTI_NAME
if [ $? != 0 ]; then
echo Error creating $MULTI_NAME
exit $? exit $?
fi fi
@ -2238,10 +2308,19 @@ export CLIENT_NAME=${INSTALLDIR}static/vlmcs${SUFFIX}-static
export MULTI_NAME=${INSTALLDIR}static/vlmcsdmulti${SUFFIX}-static export MULTI_NAME=${INSTALLDIR}static/vlmcsdmulti${SUFFIX}-static
export LDFLAGS="-Wl,-z,norelro -fwhole-program -static" export LDFLAGS="-Wl,-z,norelro -fwhole-program -static"
make $REUSEOBJFLAGS CAT=2 $CLIENT_NAME $MULTI_NAME $PROGRAM_NAME make $REUSEOBJFLAGS SAFE_MODE=1 $MULTI_NAME
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME, $MULTI_NAME and/or $PROGRAM_NAME echo Error creating $MULTI_NAME
exit $?
fi
rm vlmcsd.o vlmcs.o vlmcsdmulti.o
make $REUSEOBJFLAGS SAFE_MODE=1
if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME and/or $PROGRAM_NAME
exit $? exit $?
fi fi
@ -2315,32 +2394,6 @@ fi
# Linux PowerPC glibc with SSL support and Dreambox 500 toolchain
INSTALLDIR=binaries/Linux/ppc/big-endian/glibc/
SUFFIX=-ppc-glibc-openssl0.9.8-soft-EXPERIMENTAL
export PROGRAM_NAME=${INSTALLDIR}vlmcsd${SUFFIX}
export CLIENT_NAME=${INSTALLDIR}vlmcs${SUFFIX}
export MULTI_NAME=${INSTALLDIR}vlmcsdmulti${SUFFIX}
export CC=/opt/simplebuild/toolchains/powerpc/bin/powerpc-linux-gcc
export PLATFORMFLAGS="-pipe"
export FEATURES=full
export CFLAGS="-fno-common -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
export LDFLAGS="-Wl,--no-gc-sections -Wl,-z,norelro"
export THREADS=0
export CRYPTO=internal
make NO_DNS=1 $MAKEFLAGS CAT=2 $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME, $MULTI_NAME and/or $PROGRAM_NAME
exit $?
fi
#Linux PowerPC uclibc OpenWRT toolchain #Linux PowerPC uclibc OpenWRT toolchain
INSTALLDIR=binaries/Linux/ppc/big-endian/ INSTALLDIR=binaries/Linux/ppc/big-endian/
SUFFIX=-ppc-uclibc SUFFIX=-ppc-uclibc
@ -2531,6 +2584,30 @@ fi
#Fritzbox 7370 (mips32r2 big-endian) device specific with simple sockets and some features disabled, May or may not run on other devices
INSTALLDIR=binaries/Linux/mips/big-endian/uclibc/
SUFFIX=-mips16-Fritzbox-33xx-73xx-74xx-63xx-64xx-uclibc-simple
export PROGRAM_NAME=${INSTALLDIR}vlmcsd${SUFFIX}
export CLIENT_NAME=${INSTALLDIR}vlmcs${SUFFIX}
export MULTI_NAME=${INSTALLDIR}vlmcsdmulti${SUFFIX}
export CC=/opt/simplebuild/toolchains/fritz73xxOS62/bin/mips-linux-cc
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -march=24kc -mtune=24kc -mips16 -mdsp"
export FEATURES=full
export CFLAGS="$SMALLCC -DNO_USER_SWITCH -DSIMPLE_SOCKETS -DNO_PID_FILE -DNO_USER_SWITCH -DNO_USER_SWITCH"
export LDFLAGS="$SMALLLD"
export THREADS=0
export CRYPTO=internal
make NOLRESOLV=1 $MAKEFLAGS $PROGRAM_NAME
if [ $? != 0 ]; then
echo Error creating $PROGRAM_NAME
exit $?
fi
#Fritzbox 7370 (mips32r2 big-endian) device specific inetd start only, May or may not run on other devices #Fritzbox 7370 (mips32r2 big-endian) device specific inetd start only, May or may not run on other devices
INSTALLDIR=binaries/Linux/mips/big-endian/uclibc/ INSTALLDIR=binaries/Linux/mips/big-endian/uclibc/
SUFFIX=-mips16-Fritzbox-33xx-73xx-74xx-63xx-64xx-uclibc-inetd SUFFIX=-mips16-Fritzbox-33xx-73xx-74xx-63xx-64xx-uclibc-inetd
@ -3132,7 +3209,7 @@ fi
#Linux Sparc32v7 glibc #Linux Sparc32v7 glibc
INSTALLDIR=binaries/Linux/sparc32/glibc/ INSTALLDIR=binaries/Linux/sparc/glibc/
SUFFIX=-sparc32v7-glibc SUFFIX=-sparc32v7-glibc
export PROGRAM_NAME=${INSTALLDIR}vlmcsd${SUFFIX} export PROGRAM_NAME=${INSTALLDIR}vlmcsd${SUFFIX}
export CLIENT_NAME=${INSTALLDIR}vlmcs${SUFFIX} export CLIENT_NAME=${INSTALLDIR}vlmcs${SUFFIX}
@ -3141,7 +3218,7 @@ export CC=/opt/toolchains/sparc32-glibc-gcc-4.7.4/bin/sparc-buildroot-linux-gnu-
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mcpu=v7" export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mcpu=v7"
export FEATURES=full export FEATURES=full
export CFLAGS="$SMALLCC" export CFLAGS="$SMALLCC"
export LDFLAGS="$SMALLLD -lpthread" export LDFLAGS="$SMALLLD"
export THREADS=0 export THREADS=0
export CRYPTO=internal export CRYPTO=internal
@ -3330,7 +3407,7 @@ export LDFLAGS="-fwhole-program"
export THREADS=0 export THREADS=0
export CRYPTO=internal export CRYPTO=internal
make $MAKEFLAGS CAT=2 $PROGRAM_NAME $MULTI_NAME $CLIENT_NAME make $MAKEFLAGS CAT=2 SAFE_MODE=1 $PROGRAM_NAME $MULTI_NAME $CLIENT_NAME
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $PROGRAM_NAME, $MULTI_NAME and/or $CLIENT_NAME echo Error creating $PROGRAM_NAME, $MULTI_NAME and/or $CLIENT_NAME
@ -3342,7 +3419,7 @@ export CLIENT_NAME=${INSTALLDIR}static/vlmcs${SUFFIX}-static
export MULTI_NAME=${INSTALLDIR}static/vlmcsdmulti${SUFFIX}-static export MULTI_NAME=${INSTALLDIR}static/vlmcsdmulti${SUFFIX}-static
export LDFLAGS="-fwhole-program -static" export LDFLAGS="-fwhole-program -static"
make $REUSEOBJFLAGS CAT=2 $PROGRAM_NAME $MULTI_NAME $CLIENT_NAME make $REUSEOBJFLAGS CAT=2 SAFE_MODE=1 $PROGRAM_NAME $MULTI_NAME $CLIENT_NAME
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $PROGRAM_NAME, $MULTI_NAME and/or $CLIENT_NAME echo Error creating $PROGRAM_NAME, $MULTI_NAME and/or $CLIENT_NAME
@ -3456,7 +3533,7 @@ export CFLAGS="$SMALLCC"
export LDFLAGS="-Wl,-z,norelo" export LDFLAGS="-Wl,-z,norelo"
export THREADS=0 export THREADS=0
make $MAKEFLAGS CAT=2 $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME make $MAKEFLAGS SAFE_MODE=1 CAT=2 $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME, $MULTI_NAME and/or $PROGRAM_NAME echo Error creating $CLIENT_NAME, $MULTI_NAME and/or $PROGRAM_NAME
@ -3468,7 +3545,7 @@ export CLIENT_NAME=${INSTALLDIR}static/vlmcs${SUFFIX}-static
export MULTI_NAME=${INSTALLDIR}static/vlmcsdmulti${SUFFIX}-static export MULTI_NAME=${INSTALLDIR}static/vlmcsdmulti${SUFFIX}-static
export LDFLAGS="-Wl,-z,norelo -static" export LDFLAGS="-Wl,-z,norelo -static"
make $REUSEOBJFLAGS CAT=2 $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME make $REUSEOBJFLAGS SAFE_MODE=1 CAT=2 $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo Error creating $CLIENT_NAME, $MULTI_NAME and/or $PROGRAM_NAME echo Error creating $CLIENT_NAME, $MULTI_NAME and/or $PROGRAM_NAME
@ -3478,9 +3555,9 @@ fi
# Strip off unnecessary stuff from binaries # Strip off unnecessary stuff from binaries
find binaries -xdev -name 'vlmcs*' -exec /opt/toolchains/mips32el-mips16-glibc-2.18/usr/bin/mipsel-linux-strip -s --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag {} \; 2>/dev/null #find binaries -xdev -name 'vlmcs*' -exec /opt/toolchains/mips32el-mips16-glibc-2.18/usr/bin/mipsel-linux-strip -s --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag {} \; 2>/dev/null
find binaries -xdev -name 'vlmcs*' -exec strip -s --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag {} \; 2>/dev/null #find binaries -xdev -name 'vlmcs*' -exec strip -s --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag {} \; 2>/dev/null
find binaries -xdev -name 'vlmcs*' -exec sstrip -z {} \; 2>/dev/null find binaries -xdev -name 'vlmcs*' ! -name '*-NetBSD-*' ! -name '*-Windows-*' ! -name '*-cygwin-*' ! -name '*-MacOSX-*' ! -name '*-iOS-*' -exec sstrip -z {} \;
make alldocs make alldocs

3507
make_lxss Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,50 +0,0 @@
#!/bin/bash
SMALLCC="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
SMALLLD="-pipe -Wl,--hash-style=sysv -Wl,-z,norelro -Wl,--build-id=none"
SMALL="$SMALLCC $SMALLLD"
export CFLAGS="$SMALLCC"
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -m31 -mesa -mpacked-stack -msmall-exec"
export LDFLAGS="$SMALLLD -Wl,--hash-style=gnu"
export THREADS=0
export FEATURES=full
export MULTI_NAME=vlmcsdmulti-s390-glibc
export CLIENT_NAME=vlmcs-s390-glibc
export PROGRAM_NAME=vlmcsd-s390-glibc
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -m64 -mzarch -mpacked-stack -msmall-exec"
export MULTI_NAME=vlmcsdmulti-s390x-glibc
export CLIENT_NAME=vlmcs-s390x-glibc
export PROGRAM_NAME=vlmcsd-s390x-glibc
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -m64 -mzarch -mpacked-stack -msmall-exec"
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
cp -af vlmcsd-s390-glibc /usr/local/sbin/vlmcsd
cp -af vlmcs-s390-glibc /usr/local/bin/vlmcs
mkdir -p /usr/local/man/man1 2>/dev/null
mkdir -p /usr/local/man/man5 2>/dev/null
mkdir -p /usr/local/man/man8 2>/dev/null
mkdir -p /usr/local/man/man7 2>/dev/null
cp -a vlmcs.1 vlmcsdmulti.1 /usr/local/man/man1/
cp -a vlmcsd.7 /usr/local/man/man7/
cp -a vlmcsd.8 /usr/local/man/man8/
cp -a vlmcsd.ini.5 /usr/local/man/man5/
pbzip2 -f -9 /usr/local/man/man5/vlmcsd.ini.5 /usr/local/man/man1/vlmcs.1 /usr/local/man/man1/vlmcsdmulti.1 /usr/local/man/man7/vlmcsd.7 /usr/local/man/man8/vlmcsd.8
scp -p vlmcsdmulti-s390-glibc vlmcs-s390-glibc vlmcsd-s390-glibc vlmcsdmulti-s390x-glibc vlmcs-s390x-glibc vlmcsd-s390x-glibc ubuntu64.internal:x/binaries/Linux/s390/glibc

137
make_multilib_linux Executable file
View File

@ -0,0 +1,137 @@
#!/bin/bash
SMALLCC="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
SMALLLD="-pipe -Wl,--hash-style=sysv -Wl,-z,norelro -Wl,--build-id=none"
SMALL="$SMALLCC $SMALLLD"
rm -f vlmcsd vlmcs vlmcsdmulti vlmcsd-* vlmcs-* vlmcsdmulti-*
## IBM S/390
export CFLAGS="$SMALLCC"
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -m31 -mesa -mpacked-stack -msmall-exec"
export LDFLAGS="$SMALLLD -Wl,--hash-style=gnu"
export THREADS=0
export FEATURES=full
export CC=s390x-linux-gnu-gcc
export VERBOSE=3
export MULTI_NAME=vlmcsdmulti-s390-glibc
export CLIENT_NAME=vlmcs-s390-glibc
export PROGRAM_NAME=vlmcsd-s390-glibc
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -m64 -mzarch -mpacked-stack -msmall-exec"
export MULTI_NAME=vlmcsdmulti-s390x-glibc
export CLIENT_NAME=vlmcs-s390x-glibc
export PROGRAM_NAME=vlmcsd-s390x-glibc
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -m64 -mzarch -mpacked-stack -msmall-exec"
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
## SPARC64
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mcpu=v7"
export LDFLAGS="$SMALLLD"
export CC=sparc64-linux-gnu-gcc
export MULTI_NAME=vlmcsdmulti-sparc64v9-glibc
export CLIENT_NAME=vlmcs-sparc64v9-glibc
export PROGRAM_NAME=vlmcsd-sparc64v9-glibc
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
## MIPS64 BIG-ENDIAN
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mips64 -mno-mips16"
export LDFLAGS="$SMALLLD"
export CC=mips64-linux-gnuabi64-gcc
export MULTI_NAME=vlmcsdmulti-mips64-glibc
export CLIENT_NAME=vlmcs-mips64-glibc
export PROGRAM_NAME=vlmcsd-mips64-glibc
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mips64 -mmicromips"
export MULTI_NAME=vlmcsdmulti-mips64mm-glibc
export CLIENT_NAME=vlmcs-mips64mm-glibc
export PROGRAM_NAME=vlmcsd-mips64mm-glibc
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
## MIPS64 LITTLE-ENDIAN
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mips64 -mno-mips16"
export LDFLAGS="$SMALLLD"
export CC=mips64el-linux-gnuabi64-gcc
export MULTI_NAME=vlmcsdmulti-mips64el-glibc
export CLIENT_NAME=vlmcs-mips64el-glibc
export PROGRAM_NAME=vlmcsd-mips64el-glibc
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
export PLATFORMFLAGS="-flto=jobserver -fwhole-program -mips64 -mmicromips"
export MULTI_NAME=vlmcsdmulti-mips64elmm-glibc
export CLIENT_NAME=vlmcs-mips64elmm-glibc
export PROGRAM_NAME=vlmcsd-mips64elmm-glibc
make -B -j`nproc` $CLIENT_NAME $PROGRAM_NAME
rm -f vlmcsd.o vlmcs.o vlmcsdmulti.o
make -j`nproc` $MULTI_NAME
sstrip -z $CLIENT_NAME $PROGRAM_NAME $MULTI_NAME
if [ "$1" == "nocopy" ]; then
exit 0
fi
mkdir -p /usr/local/man/man1 2>/dev/null
mkdir -p /usr/local/man/man5 2>/dev/null
mkdir -p /usr/local/man/man8 2>/dev/null
mkdir -p /usr/local/man/man7 2>/dev/null
cp -a vlmcs.1 vlmcsdmulti.1 /usr/local/man/man1/
cp -a vlmcsd.7 /usr/local/man/man7/
cp -a vlmcsd.8 /usr/local/man/man8/
cp -a vlmcsd.ini.5 /usr/local/man/man5/
pbzip2 -f -9 /usr/local/man/man5/vlmcsd.ini.5 /usr/local/man/man1/vlmcs.1 /usr/local/man/man1/vlmcsdmulti.1 /usr/local/man/man7/vlmcsd.7 /usr/local/man/man8/vlmcsd.8
scp -p vlmcsdmulti-s390-glibc vlmcs-s390-glibc vlmcsd-s390-glibc vlmcsdmulti-s390x-glibc vlmcs-s390x-glibc vlmcsd-s390x-glibc ubuntu64.internal:x/binaries/Linux/s390/glibc
scp -p vlmcsdmulti-sparc64v9-glibc vlmcs-sparc64v9-glibc vlmcsd-sparc64v9-glibc ubuntu64.internal:x/binaries/Linux/sparc/glibc
scp -p vlmcsdmulti-mips64-glibc vlmcs-mips64-glibc vlmcsd-mips64-glibc vlmcsdmulti-mips64mm-glibc vlmcs-mips64mm-glibc vlmcsd-mips64mm-glibc ubuntu64.internal:x/binaries/Linux/mips/big-endian/glibc
scp -p vlmcsdmulti-mips64el-glibc vlmcs-mips64el-glibc vlmcsd-mips64el-glibc vlmcsdmulti-mips64elmm-glibc vlmcs-mips64elmm-glibc vlmcsd-mips64elmm-glibc ubuntu64.internal:x/binaries/Linux/mips/little-endian/glibc
scp -p -P 2222 vlmcsdmulti-s390-glibc vlmcs-s390-glibc vlmcsd-s390-glibc vlmcsdmulti-s390x-glibc vlmcs-s390x-glibc vlmcsd-s390x-glibc s390:vlmcsd
scp -p -P 2222 vlmcsdmulti-s390-glibc vlmcsdmulti-s390x-glibc s390:/usr/local/sbin

View File

@ -4,7 +4,7 @@ export VERBOSE=3
export DNS_PARSER=OS export DNS_PARSER=OS
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null gmake clean
MAKEFLAGS="-B -j12" MAKEFLAGS="-B -j12"
REUSEOBJFLAGS="-j12" REUSEOBJFLAGS="-j12"
@ -15,17 +15,17 @@ CFCLANG="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tabl
LF="-Wl,-z,norelro -Wl,--hash-style=sysv -Wl,--build-id=none" LF="-Wl,-z,norelro -Wl,--hash-style=sysv -Wl,--build-id=none"
LFCLANG="-Wl,-z,norelro -Wl,--hash-style=sysv" LFCLANG="-Wl,-z,norelro -Wl,--hash-style=sysv"
gmake $MAKEFLAGS CC=/usr/pkg/gcc49/bin/gcc PROGRAM_NAME=vlmcsd-NetBSD-x64 CLIENT_NAME=vlmcs-NetBSD-x64 CFLAGS="$CF" LDFLAGS="$LF" gmake $MAKEFLAGS CC=/usr/pkg/gcc5/bin/gcc PROGRAM_NAME=vlmcsd-NetBSD-x64 CLIENT_NAME=vlmcs-NetBSD-x64 CFLAGS="$CF" LDFLAGS="$LF"
rm vlmcsd.o vlmcs.o rm vlmcsd.o vlmcs.o
gmake vlmcsdmulti-NetBSD-x64 $REUSEOBJFLAGS CC=/usr/pkg/gcc49/bin/gcc CFLAGS="$CF" LDFLAGS="$LF" MULTI_NAME=vlmcsdmulti-NetBSD-x64 gmake vlmcsdmulti-NetBSD-x64 $REUSEOBJFLAGS CC=/usr/pkg/gcc5/bin/gcc CFLAGS="$CF" LDFLAGS="$LF" MULTI_NAME=vlmcsdmulti-NetBSD-x64
gmake allmulti $MAKEFLAGS CAT=2 MULTI_NAME=vlmcsdmulti-NetBSD-x86 PROGRAM_NAME=vlmcsd-NetBSD-x86 CLIENT_NAME=vlmcs-NetBSD-x86 CFLAGS="$CF45 -m32" LDFLAGS="$LF" gmake allmulti CC=gcc $MAKEFLAGS CAT=2 MULTI_NAME=vlmcsdmulti-NetBSD-x86 PROGRAM_NAME=vlmcsd-NetBSD-x86 CLIENT_NAME=vlmcs-NetBSD-x86 CFLAGS="$CF45 -m32" LDFLAGS="$LF"
#gmake $MAKEFLAGS CC=clang PROGRAM_NAME=vlmcsd-NetBSD-x64-clang CLIENT_NAME=vlmcs-NetBSD-x64-clang CFLAGS="$CFCLANG" LDFLAGS="$LFCLANG" #gmake $MAKEFLAGS CC=clang PROGRAM_NAME=vlmcsd-NetBSD-x64-clang CLIENT_NAME=vlmcs-NetBSD-x64-clang CFLAGS="$CFCLANG" LDFLAGS="$LFCLANG"
rm *.o rm *.o
strip -s --strip-unneeded --remove-section=.eh_frame_hdr --remove-section=.eh_frame --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag vlmcs-* vlmcsd-* vlmcsdmulti-* strip -s --strip-unneeded -R .ident -R .got -R .note.netbsd.pax -R .gnu.version -R .eh_frame -R .note.gnu.gold-version -R .comment -R .note -R .note.gnu.build-id -R .note.ABI-tag vlmcs-* vlmcsd-* vlmcsdmulti-*
#sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-* #sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-*
cp -af vlmcsd-NetBSD-x86 /usr/local/sbin/vlmcsd cp -af vlmcsd-NetBSD-x86 /usr/local/sbin/vlmcsd

View File

@ -6,7 +6,7 @@ export DNS_PARSER=OS
rm vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null rm vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm vlmcsd vlmcs vlmcsdmulti 2>/dev/null rm vlmcsd vlmcs vlmcsdmulti 2>/dev/null
MAKEFLAGS="-j -B" MAKEFLAGS="-Bj"
REUSEOBJFLAGS="-j" REUSEOBJFLAGS="-j"
CFGCC="-static-libgcc -mdynamic-no-pic -Os -flto=jobserver -fwhole-program -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants" CFGCC="-static-libgcc -mdynamic-no-pic -Os -flto=jobserver -fwhole-program -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
CFCLANG="-mdynamic-no-pic -Os -flto -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants" CFCLANG="-mdynamic-no-pic -Os -flto -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
@ -27,12 +27,12 @@ make $MAKEFLAGS vlmcsd-MacOSX-x64-threads THREADS=1 PROGRAM_NAME=vlmcsd-MacOSX-x
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \ rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
#make $REUSEOBJFLAGS vlmcsdmulti-iOS-7.1-armv7 MULTI_NAME=vlmcsdmulti-iOS-7.1-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk" && \ #make $REUSEOBJFLAGS vlmcsdmulti-iOS-7.1-armv7 MULTI_NAME=vlmcsdmulti-iOS-7.1-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk" && \
make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-9.1-armv7 PROGRAM_NAME=vlmcsd-iOS-9.1-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 -isysroot ~/toolchains/iPhoneOS9.1.sdk" && \ make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-armv7 PROGRAM_NAME=vlmcsd-iOS-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 -isysroot ~/toolchains/iPhoneOS.sdk" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \ rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
make $REUSEOBJFLAGS vlmcsdmulti-iOS-9.1-armv7 MULTI_NAME=vlmcsdmulti-iOS-9.1-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 -isysroot ~/toolchains/iPhoneOS9.1.sdk" && \ make $REUSEOBJFLAGS vlmcsdmulti-iOS-armv7 MULTI_NAME=vlmcsdmulti-iOS-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 -isysroot ~/toolchains/iPhoneOS.sdk" && \
make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-9.1-armv8-aarch64 PROGRAM_NAME=vlmcsd-iOS-9.1-armv8-aarch64 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -arch arm64 -miphoneos-version-min=7.0 -isysroot ~/toolchains/iPhoneOS9.1.sdk" && \ make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-armv8-aarch64 PROGRAM_NAME=vlmcsd-iOS-armv8-aarch64 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -arch arm64 -miphoneos-version-min=7.0 -isysroot ~/toolchains/iPhoneOS.sdk" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \ rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
make $REUSEOBJFLAGS vlmcsdmulti-iOS-9.1-armv8-aarch64 MULTI_NAME=vlmcsdmulti-iOS-9.1-armv8-aarch64 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -arch arm64 -miphoneos-version-min=7.0 -isysroot ~/toolchains/iPhoneOS9.1.sdk" && \ make $REUSEOBJFLAGS vlmcsdmulti-iOS-armv8-aarch64 MULTI_NAME=vlmcsdmulti-iOS-armv8-aarch64 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-m64 -arch arm64 -miphoneos-version-min=7.0 -isysroot ~/toolchains/iPhoneOS.sdk" && \
make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-6.1-armv7 PROGRAM_NAME=vlmcsd-iOS-6.1-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 --sysroot ~/toolchains/iPhoneOS6.1.sdk -isysroot ~/toolchains/iPhoneOS6.1.sdk" && \ make $MAKEFLAGS CLIENT_NAME=vlmcs-iOS-6.1-armv7 PROGRAM_NAME=vlmcsd-iOS-6.1-armv7 CC=clang CFLAGS="$CFCLANG" PLATFORMFLAGS="-mthumb -m32 -arch armv7 -miphoneos-version-min=1.0 --sysroot ~/toolchains/iPhoneOS6.1.sdk -isysroot ~/toolchains/iPhoneOS6.1.sdk" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \ rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
@ -56,9 +56,9 @@ PATH=~/toolchains/iOS5.1-MacOS-Lion/usr/bin:$PATH make $REUSEOBJFLAGS vlmcsdmult
#PATH=~/toolchains/gcc4.2/usr/bin:$PATH make $REUSEOBJFLAGS vlmcsdmulti-iOS-4.1-armv7-llvm-clang MULTI_NAME=vlmcsdmulti-iOS-4.1-armv7-llvm-clang CC=~/toolchains/gcc4.2/usr/bin/bin/clang CFLAGS="$CFGCC42" PLATFORMFLAGS="-mthumb -arch armv7 -miphoneos-version-min=4.1 --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk" && \ #PATH=~/toolchains/gcc4.2/usr/bin:$PATH make $REUSEOBJFLAGS vlmcsdmulti-iOS-4.1-armv7-llvm-clang MULTI_NAME=vlmcsdmulti-iOS-4.1-armv7-llvm-clang CC=~/toolchains/gcc4.2/usr/bin/bin/clang CFLAGS="$CFGCC42" PLATFORMFLAGS="-mthumb -arch armv7 -miphoneos-version-min=4.1 --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk" && \
PATH=~/toolchains/gcc4.2/usr/bin:$PATH make -Bj PROGRAM_NAME=vlmcsd-MacOSX-ppc CLIENT_NAME=vlmcs-MacOSX-ppc CC=gcc CFLAGS="$CFGCC42 -isysroot ~/toolchains/MacOSX10.5.sdk -arch ppc -mmacosx-version-min=10.0" && \ PATH=~/toolchains/gcc4.2/usr/bin:$PATH make -Bj SAFE_MODE=1 PROGRAM_NAME=vlmcsd-MacOSX-ppc CLIENT_NAME=vlmcs-MacOSX-ppc CC=gcc CFLAGS="$CFGCC42 -isysroot ~/toolchains/MacOSX10.5.sdk -arch ppc -mmacosx-version-min=10.0" && \
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \ rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.* && \
PATH=~/toolchains/gcc4.2/usr/bin:$PATH make -j vlmcsdmulti-MacOSX-ppc MULTI_NAME=vlmcsdmulti-MacOSX-ppc CC=gcc CFLAGS="$CFGCC42 -isysroot ~/toolchains/MacOSX10.5.sdk -arch ppc -mmacosx-version-min=10.0" PATH=~/toolchains/gcc4.2/usr/bin:$PATH make -j SAFE_MODE=1 vlmcsdmulti-MacOSX-ppc MULTI_NAME=vlmcsdmulti-MacOSX-ppc CC=gcc CFLAGS="$CFGCC42 -isysroot ~/toolchains/MacOSX10.5.sdk -arch ppc -mmacosx-version-min=10.0"
make $MAKEFLAGS CLIENT_NAME=vlmcs-MacOSX-x86-gcc PROGRAM_NAME=vlmcsd-MacOSX-x86-gcc CC=gcc-5 CFLAGS="$CFGCC" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.11" && \ make $MAKEFLAGS CLIENT_NAME=vlmcs-MacOSX-x86-gcc PROGRAM_NAME=vlmcsd-MacOSX-x86-gcc CC=gcc-5 CFLAGS="$CFGCC" PLATFORMFLAGS="-m32 -march=core2 -mmacosx-version-min=10.11" && \

View File

@ -10,18 +10,18 @@ CF="-Wno-missing-braces -fno-common -fno-exceptions -fno-non-call-exceptions -fn
CFMSRPC="-Wno-missing-braces -Wno-unused-variable $CF" # -fno-common -fno-stack-protector -fmerge-all-constants -pipe" CFMSRPC="-Wno-missing-braces -Wno-unused-variable $CF" # -fno-common -fno-stack-protector -fmerge-all-constants -pipe"
PF32="" PF32=""
PF64="-mpreferred-stack-boundary=4 -march=nocona -mtune=generic" PF64="-mpreferred-stack-boundary=4 -march=nocona -mtune=generic"
LFCYG32="-fwhole-program -Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware" LFCYG32="-fwhole-program -Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware,--disable-long-section-names"
LFWIN32="-fwhole-program -lws2_32 -Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware" LFWIN32="-fwhole-program -lws2_32 -Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware,--disable-long-section-names"
LFCYG64="-fwhole-program -Wl,--nxcompat,--dynamicbase,--tsaware" LFCYG64="-fwhole-program -Wl,--nxcompat,--dynamicbase,--tsaware,--disable-long-section-names,--high-entropy-va"
LFWIN64="-fwhole-program -lws2_32 -Wl,--nxcompat,--dynamicbase,--tsaware" LFWIN64="-fwhole-program -lws2_32 -Wl,--nxcompat,--dynamicbase,--tsaware,--disable-long-section-names,--high-entropy-va"
MAKEFLAGS="-j$NUMCPU -B" MAKEFLAGS="-j$NUMCPU -B"
REUSEFLAGS="-j$NUMCPU" REUSEFLAGS="-j$NUMCPU"
make $MAKEFLAGS cygkms32.dll FEATURES=minimum THREADS=1 DLL_NAME=cygkms32.dll DNS_PARSER=internal CC=i686-pc-cygwin-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32" make $MAKEFLAGS cygkms32.dll FEATURES=minimum THREADS=1 DLL_NAME=cygkms32.dll DNS_PARSER=internal CC=i686-pc-cygwin-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32 -Wl,--no-seh"
make $MAKEFLAGS cygkms64.dll FEATURES=minimum THREADS=1 DLL_NAME=cygkms64.dll DNS_PARSER=internal CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64" make $MAKEFLAGS cygkms64.dll FEATURES=minimum THREADS=1 DLL_NAME=cygkms64.dll DNS_PARSER=internal CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64 -Wl,--no-seh"
make $MAKEFLAGS all vlmcsdmulti-cygwin-x86 THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-x86 PROGRAM_NAME=vlmcsd-cygwin-x86 MULTI_NAME=vlmcsdmulti-cygwin-x86 CC=i686-pc-cygwin-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32" make $MAKEFLAGS all vlmcsdmulti-cygwin-x86 THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-x86 PROGRAM_NAME=vlmcsd-cygwin-x86 MULTI_NAME=vlmcsdmulti-cygwin-x86 CC=i686-pc-cygwin-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32 -Wl,--no-seh"
make $MAKEFLAGS all vlmcsdmulti-cygwin-x64 THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-x64 PROGRAM_NAME=vlmcsd-cygwin-x64 MULTI_NAME=vlmcsdmulti-cygwin-x64 CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64" make $MAKEFLAGS all vlmcsdmulti-cygwin-x64 THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-x64 PROGRAM_NAME=vlmcsd-cygwin-x64 MULTI_NAME=vlmcsdmulti-cygwin-x64 CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64 -Wl,--no-seh"
make $MAKEFLAGS MSRPC=1 THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-msrpc-x86 PROGRAM_NAME=vlmcsd-cygwin-msrpc-x86 MULTI_NAME=vlmcsdmulti-cygwin-msrpc-x86 CC=i686-pc-cygwin-gcc.exe CFLAGS="$CF -fasynchronous-unwind-tables" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32" make $MAKEFLAGS MSRPC=1 THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-msrpc-x86 PROGRAM_NAME=vlmcsd-cygwin-msrpc-x86 MULTI_NAME=vlmcsdmulti-cygwin-msrpc-x86 CC=i686-pc-cygwin-gcc.exe CFLAGS="$CF -fasynchronous-unwind-tables" PLATFORMFLAGS="$PF32" LDFLAGS="$LFCYG32"
make $MAKEFLAGS MSRPC=1 THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-msrpc-x64 PROGRAM_NAME=vlmcsd-cygwin-msrpc-x64 MULTI_NAME=vlmcsdmulti-cygwin-msrpc-x64 CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64" make $MAKEFLAGS MSRPC=1 THREADS=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-msrpc-x64 PROGRAM_NAME=vlmcsd-cygwin-msrpc-x64 MULTI_NAME=vlmcsdmulti-cygwin-msrpc-x64 CC=x86_64-pc-cygwin-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
unset CAT unset CAT
@ -34,19 +34,24 @@ make $MAKEFLAGS THREADS=1 MSRPC=1 DNS_PARSER=internal CLIENT_NAME=vlmcs-cygwin-m
export CAT=2 export CAT=2
make $MAKEFLAGS libkms32.dll CRYPTO=windows FEATURES=minimum THREADS=1 DLL_NAME=libkms32.dll CC=i686-w64-MingW32-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF32" LDFLAGS="-static-libgcc $LFWIN32" #make $MAKEFLAGS libkms32.dll CRYPTO=windows FEATURES=minimum THREADS=1 DLL_NAME=libkms32.dll CC=i686-w64-MingW32-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF32" LDFLAGS="-static-libgcc $LFWIN32"
make $MAKEFLAGS libkms64.dll CRYPTO=windows FEATURES=minimum THREADS=1 DLL_NAME=libkms64.dll CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF64" LDFLAGS="-static-libgcc $LFWIN64" #make $MAKEFLAGS libkms64.dll CRYPTO=windows FEATURES=minimum THREADS=1 DLL_NAME=libkms64.dll CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CF -flto=jobserver -fvisibility=hidden" PLATFORMFLAGS="$PF64" LDFLAGS="-static-libgcc $LFWIN64"
make $MAKEFLAGS all vlmcsdmulti-Windows-x86 THREADS=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-x86 PROGRAM_NAME=vlmcsd-Windows-x86 MULTI_NAME=vlmcsdmulti-Windows-x86 CC=i686-w64-MingW32-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF32" LDFLAGS="$LFWIN32" #make $MAKEFLAGS all vlmcsdmulti-Windows-x86 THREADS=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-x86 PROGRAM_NAME=vlmcsd-Windows-x86 MULTI_NAME=vlmcsdmulti-Windows-x86 CC=i686-w64-MingW32-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF32" LDFLAGS="$LFWIN32"
make $MAKEFLAGS all vlmcsdmulti-Windows-x64 THREADS=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-x64 PROGRAM_NAME=vlmcsd-Windows-x64 MULTI_NAME=vlmcsdmulti-Windows-x64 CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF64" LDFLAGS="$LFWIN64" #make $MAKEFLAGS all vlmcsdmulti-Windows-x64 THREADS=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-x64 PROGRAM_NAME=vlmcsd-Windows-x64 MULTI_NAME=vlmcsdmulti-Windows-x64 CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CF" PLATFORMFLAGS="$PF64" LDFLAGS="$LFWIN64"
make -Bj MSRPC=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-msrpc-x86 PROGRAM_NAME=vlmcsd-Windows-msrpc-x86 MULTI_NAME=vlmcsdmulti-Windows-msrpc-x86 CC=i686-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF32" LDFLAGS="-Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware" #make -Bj MSRPC=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-msrpc-x86 PROGRAM_NAME=vlmcsd-Windows-msrpc-x86 MULTI_NAME=vlmcsdmulti-Windows-msrpc-x86 CC=i686-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF32" LDFLAGS="-Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware"
make $MAKEFLAGS THREADS=1 MSRPC=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-msrpc-x64 PROGRAM_NAME=vlmcsd-Windows-msrpc-x64 MULTI_NAME=vlmcsdmulti-Windows-msrpc-x64 CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64" #make $MAKEFLAGS THREADS=1 MSRPC=1 CRYPTO=windows CLIENT_NAME=vlmcs-Windows-msrpc-x64 PROGRAM_NAME=vlmcsd-Windows-msrpc-x64 MULTI_NAME=vlmcsdmulti-Windows-msrpc-x64 CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
unset CAT #unset CAT
make $MAKEFLAGS vlmcsdmulti-Windows-msrpc-x86 THREADS=1 MSRPC=1 CRYPTO=windows MULTI_NAME=vlmcsdmulti-Windows-msrpc-x86 CC=i686-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF32" LDFLAGS="-Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware" #make $MAKEFLAGS vlmcsdmulti-Windows-msrpc-x86 THREADS=1 MSRPC=1 CRYPTO=windows MULTI_NAME=vlmcsdmulti-Windows-msrpc-x86 CC=i686-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF32" LDFLAGS="-Wl,--nxcompat,--dynamicbase,--tsaware,--large-address-aware"
make $MAKEFLAGS vlmcsdmulti-Windows-msrpc-x64 THREADS=1 MSRPC=1 CRYPTO=windows MULTI_NAME=vlmcsdmulti-Windows-msrpc-x64 CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64" #make $MAKEFLAGS vlmcsdmulti-Windows-msrpc-x64 THREADS=1 MSRPC=1 CRYPTO=windows MULTI_NAME=vlmcsdmulti-Windows-msrpc-x64 CC=x86_64-w64-MingW32-gcc.exe CFLAGS="$CFMSRPC" PLATFORMFLAGS="$PF64" LDFLAGS="$LFCYG64"
export CAT=2 export CAT=2
rm -f *_all.* *.o 2> /dev/null & rm -f *_all.* *.o 2> /dev/null &
echo ""
echo "Copying MingW binaries from distribution server"
scp -p root@ubuntu64:x/binaries/Windows/intel/* .
echo "" echo ""
echo "Installing binaries" echo "Installing binaries"

163
network.c
View File

@ -207,8 +207,88 @@ SOCKET connectToAddress(const char *const addr, const int AddressFamily, int_fas
return s; return s;
} }
// fix for lame tomato toolchain
# if !defined(IPV6_V6ONLY) && defined(__linux__)
# define IPV6_V6ONLY (26)
# endif // !defined(IPV6_V6ONLY) && defined(__linux__)
#ifndef NO_SOCKETS #ifndef NO_SOCKETS
#ifdef SIMPLE_SOCKETS
static int_fast8_t allowSocketReuse(SOCKET s)
{
# if !defined(_WIN32) && !defined(__CYGWIN__)
BOOL socketOption = TRUE;
# else // _WIN32
BOOL socketOption = FALSE;
# endif // _WIN32
if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (sockopt_t)&socketOption, sizeof(socketOption)))
{
# ifdef _PEDANTIC
printerrorf("Warning: %s does not support socket option SO_REUSEADDR: %s\n", ipstr, vlmcsd_strerror(socket_errno));
# endif // _PEDANTIC
}
return 0;
}
int listenOnAllAddresses()
{
uint32_t port_listen;
if (!stringToInt(defaultport, 1, 65535, &port_listen))
{
printerrorf("Fatal: Port must be numeric between 1 and 65535.\n");
exit(!0);
}
struct sockaddr_in6 addr;
memset(&addr, 0, sizeof(addr));
addr.sin6_family = AF_INET6;
addr.sin6_port = BE16((uint16_t)port_listen);
addr.sin6_addr = in6addr_any;
BOOL v6only = FALSE;
s_server = socket(AF_INET6, SOCK_STREAM, 0);
if (s_server == INVALID_SOCKET
|| allowSocketReuse(s_server)
|| setsockopt(s_server, IPPROTO_IPV6, IPV6_V6ONLY, (sockopt_t)&v6only, sizeof(v6only))
|| bind(s_server, (struct sockaddr *)&addr, sizeof(addr))
|| listen(s_server, SOMAXCONN) )
{
socketclose(s_server);
struct sockaddr_in addr = {
.sin_family = AF_INET,
.sin_port = BE16((uint16_t)port_listen),
};
addr.sin_addr.s_addr = BE32(INADDR_ANY);
s_server = socket(AF_INET, SOCK_STREAM, 0);
if ( s_server == INVALID_SOCKET
|| allowSocketReuse(s_server)
|| bind(s_server, (struct sockaddr *)&addr, sizeof(addr))
|| listen(s_server, SOMAXCONN) )
{
int error = socket_errno;
printerrorf("Fatal: Cannot bind to TCP port %u: %s\n", port_listen, vlmcsd_strerror(error));
return error;
}
}
#ifndef NO_LOG
logger("Listening on TCP port %u\n", port_listen);
#endif // NO_LOG
return 0;
}
#else // !SIMPLE_SOCKETS
// Create a Listening socket for addrinfo sa and return socket s // Create a Listening socket for addrinfo sa and return socket s
// szHost and szPort are for logging only // szHost and szPort are for logging only
@ -249,20 +329,67 @@ static int listenOnAddress(const struct addrinfo *const ai, SOCKET *s)
BOOL socketOption = TRUE; BOOL socketOption = TRUE;
// fix for lame tomato toolchain
# ifndef IPV6_V6ONLY
# ifdef __linux__
# define IPV6_V6ONLY (26)
# endif // __linux__
# endif // IPV6_V6ONLY
# ifdef IPV6_V6ONLY # ifdef IPV6_V6ONLY
if (ai->ai_family == AF_INET6) setsockopt(*s, IPPROTO_IPV6, IPV6_V6ONLY, (sockopt_t)&socketOption, sizeof(socketOption)); if (ai->ai_family == AF_INET6 && setsockopt(*s, IPPROTO_IPV6, IPV6_V6ONLY, (sockopt_t)&socketOption, sizeof(socketOption)))
{
# ifdef _PEDANTIC
# if defined(_WIN32) || defined(__CYGWIN__)
// if (IsWindowsVistaOrGreater()) //Doesn't work with older version of MingW32-w64 toolchain
if ((GetVersion() & 0xff) > 5)
# endif // _WIN32
printerrorf("Warning: %s does not support socket option IPV6_V6ONLY: %s\n", ipstr, vlmcsd_strerror(socket_errno));
# endif // _PEDANTIC
}
# endif # endif
# ifndef _WIN32 # ifndef _WIN32
setsockopt(*s, SOL_SOCKET, SO_REUSEADDR, (sockopt_t)&socketOption, sizeof(socketOption)); if (setsockopt(*s, SOL_SOCKET, SO_REUSEADDR, (sockopt_t)&socketOption, sizeof(socketOption)))
# endif {
# ifdef _PEDANTIC
printerrorf("Warning: %s does not support socket option SO_REUSEADDR: %s\n", ipstr, vlmcsd_strerror(socket_errno));
# endif // _PEDANTIC
}
# endif // _WIN32
# if HAVE_FREEBIND
# if (defined(IP_NONLOCALOK) || __FreeBSD_kernel__ || __FreeBSD__) && !defined(IPV6_BINDANY)
# define IPV6_BINDANY 64
# endif // (defined(IP_NONLOCALOK) || __FreeBSD_kernel__ || __FreeBSD__) && !defined(IPV6_BINDANY)
if (freebind)
{
# if defined(IP_FREEBIND) // Linux
if (setsockopt(*s, IPPROTO_IP, IP_FREEBIND, (sockopt_t)&socketOption, sizeof(socketOption)))
{
printerrorf("Warning: Cannot use FREEBIND on %s: %s\n", ipstr, vlmcsd_strerror(socket_errno));
}
# endif // defined(IP_FREEBIND)
# if defined(IP_BINDANY) // FreeBSD IPv4
if (ai->ai_family == AF_INET && setsockopt(*s, IPPROTO_IP, IP_BINDANY, (sockopt_t)&socketOption, sizeof(socketOption)))
{
printerrorf("Warning: Cannot use BINDANY on %s: %s\n", ipstr, vlmcsd_strerror(socket_errno));
}
# endif // defined(IP_BINDANY)
# if defined(IPV6_BINDANY) // FreeBSD IPv6
if (ai->ai_family == AF_INET6 && setsockopt(*s, IPPROTO_IP, IPV6_BINDANY, (sockopt_t)&socketOption, sizeof(socketOption)))
{
# ifdef _PEDANTIC // FreeBSD defines the symbol but doesn't have BINDANY in IPv6 (Kame stack doesn't have it)
printerrorf("Warning: Cannot use BINDANY on %s: %s\n", ipstr, vlmcsd_strerror(socket_errno));
# endif
}
# endif // defined(IPV6_BINDANY)
# if defined(IP_NONLOCALOK) && !defined(IP_BINDANY) // FreeBSD with GNU userspace IPv4
if (ai->ai_family == AF_INET && setsockopt(*s, IPPROTO_IP, IP_NONLOCALOK, (sockopt_t)&socketOption, sizeof(socketOption)))
{
printerrorf("Warning: Cannot use BINDANY on %s: %s\n", ipstr, vlmcsd_strerror(socket_errno));
}
# endif // defined(IP_NONLOCALOK) && !defined(IP_BINDANY)
}
# endif // HAVE_FREEBIND
if (bind(*s, ai->ai_addr, ai->ai_addrlen) || listen(*s, SOMAXCONN)) if (bind(*s, ai->ai_addr, ai->ai_addrlen) || listen(*s, SOMAXCONN))
{ {
@ -279,7 +406,6 @@ static int listenOnAddress(const struct addrinfo *const ai, SOCKET *s)
return 0; return 0;
} }
// Adds a listening socket for an address string, // Adds a listening socket for an address string,
// e.g. 127.0.0.1:1688 or [2001:db8:dead:beef::1]:1688 // e.g. 127.0.0.1:1688 or [2001:db8:dead:beef::1]:1688
BOOL addListeningSocket(const char *const addr) BOOL addListeningSocket(const char *const addr)
@ -366,10 +492,18 @@ static SOCKET network_accept_any()
else else
return accept(sock, NULL, NULL); return accept(sock, NULL, NULL);
} }
#endif // !SIMPLE_SOCKETS
void closeAllListeningSockets() void closeAllListeningSockets()
{ {
# ifdef SIMPLE_SOCKETS
shutdown(s_server, VLMCSD_SHUT_RDWR);
socketclose(s_server);
# else // !SIMPLE_SOCKETS
int i; int i;
for (i = 0; i < numsockets; i++) for (i = 0; i < numsockets; i++)
@ -377,6 +511,8 @@ void closeAllListeningSockets()
shutdown(SocketList[i], VLMCSD_SHUT_RDWR); shutdown(SocketList[i], VLMCSD_SHUT_RDWR);
socketclose(SocketList[i]); socketclose(SocketList[i]);
} }
#endif // !SIMPLE_SOCKETS
} }
#endif // NO_SOCKETS #endif // NO_SOCKETS
@ -641,13 +777,16 @@ int runServer()
return 0; return 0;
} }
// Standalone mode
for (;;) for (;;)
{ {
int error; int error;
SOCKET s_client; SOCKET s_client;
#ifdef SIMPLE_SOCKETS
if ( (s_client = accept(s_server, NULL, NULL)) == INVALID_SOCKET )
#else // Standalone mode fully featured sockets
if ( (s_client = network_accept_any()) == INVALID_SOCKET ) if ( (s_client = network_accept_any()) == INVALID_SOCKET )
#endif // Standalone mode fully featured sockets
{ {
error = socket_errno; error = socket_errno;

View File

@ -22,6 +22,9 @@ int_fast8_t sendrecv(SOCKET sock, BYTE *data, int len, int_fast8_t do_send);
#ifndef NO_SOCKETS #ifndef NO_SOCKETS
void closeAllListeningSockets(); void closeAllListeningSockets();
#ifdef SIMPLE_SOCKETS
int listenOnAllAddresses();
#endif // SIMPLE_SOCKETS
BOOL addListeningSocket(const char *const addr); BOOL addListeningSocket(const char *const addr);
__pure int_fast8_t checkProtocolStack(const int addressfamily); __pure int_fast8_t checkProtocolStack(const int addressfamily);

395
output.c
View File

@ -94,25 +94,35 @@ int logger(const char *const fmt, ...)
// Output to stderr if it is available or to log otherwise (e.g. if running as daemon/service) // Output to stderr if it is available or to log otherwise (e.g. if running as daemon/service)
void printerrorf(const char *const fmt, ...) void printerrorf(const char *const fmt, ...)
{ {
int error = errno;
va_list arglist; va_list arglist;
va_start(arglist, fmt); va_start(arglist, fmt);
#ifndef NO_LOG # ifdef IS_LIBRARY
#ifdef _NTSERVICE
snprintf(ErrorMessage, MESSAGE_BUFFER_SIZE, fmt, arglist);
# else // !IS_LIBRARY
# ifndef NO_LOG
# ifdef _NTSERVICE
if (InetdMode || IsNTService) if (InetdMode || IsNTService)
#else // !_NTSERVICE # else // !_NTSERVICE
if (InetdMode) if (InetdMode)
#endif // NTSERVIICE # endif // NTSERVIICE
vlogger(fmt, arglist); vlogger(fmt, arglist);
else else
#endif //NO_LOG # endif //NO_LOG
# endif // IS_LIBRARY
{ {
vfprintf(stderr, fmt, arglist); vfprintf(stderr, fmt, arglist);
fflush(stderr); fflush(stderr);
} }
va_end(arglist); va_end(arglist);
errno = error;
} }
@ -130,10 +140,12 @@ int errorout(const char* fmt, ...)
} }
#ifndef NO_VERBOSE_LOG
static const char *LicenseStatusText[] = static const char *LicenseStatusText[] =
{ {
"Unlicensed", "Licensed", "OOB grace", "OOT grace", "Non-Genuine", "Notification", "Extended grace" "Unlicensed", "Licensed", "OOB grace", "OOT grace", "Non-Genuine", "Notification", "Extended grace"
}; };
#endif // NO_VERBOSE_LOG
void uuid2StringLE(const GUID *const guid, char *const string) void uuid2StringLE(const GUID *const guid, char *const string)
@ -152,7 +164,7 @@ void uuid2StringLE(const GUID *const guid, char *const string)
); );
} }
#ifndef NO_VERBOSE_LOG
void logRequestVerbose(const REQUEST *const Request, const PRINTFUNC p) void logRequestVerbose(const REQUEST *const Request, const PRINTFUNC p)
{ {
char guidBuffer[GUID_STRING_LENGTH + 1]; char guidBuffer[GUID_STRING_LENGTH + 1];
@ -208,7 +220,6 @@ void logRequestVerbose(const REQUEST *const Request, const PRINTFUNC p)
p("N count policy (minimum clients): %u\n", (uint32_t)LE32(Request->N_Policy)); p("N count policy (minimum clients): %u\n", (uint32_t)LE32(Request->N_Policy));
} }
void logResponseVerbose(const char *const ePID, const BYTE *const hwid, const RESPONSE *const response, const PRINTFUNC p) void logResponseVerbose(const char *const ePID, const BYTE *const hwid, const RESPONSE *const response, const PRINTFUNC p)
{ {
char guidBuffer[GUID_STRING_LENGTH + 1]; char guidBuffer[GUID_STRING_LENGTH + 1];
@ -237,4 +248,374 @@ void logResponseVerbose(const char *const ePID, const BYTE *const hwid, const RE
p("Renewal interval policy : %u\n", (uint32_t)LE32(response->VLRenewalInterval)); p("Renewal interval policy : %u\n", (uint32_t)LE32(response->VLRenewalInterval));
p("Activation interval policy : %u\n", (uint32_t)LE32(response->VLActivationInterval)); p("Activation interval policy : %u\n", (uint32_t)LE32(response->VLActivationInterval));
} }
#endif // NO_VERBOSE_LOG
#ifndef NO_VERSION_INFORMATION
void printPlatform()
{
int testNumber = 0x1234;
# ifdef VLMCSD_COMPILER
printf
(
"Compiler: %s\n", VLMCSD_COMPILER
# ifdef __VERSION__
" " __VERSION__
# endif // __VERSION__
);
# endif // VLMCSD_COMPILER
printf
(
"Intended platform:%s %s\n", ""
# if __i386__ || _M_IX86
" Intel x86"
# endif
# if __x86_64__ || __amd64__ || _M_X64 || _M_AMD64
" Intel x86_64"
# endif
# if _M_ARM || __arm__
" ARM"
# endif
# if __thumb__
" thumb"
# endif
# if __aarch64__
" ARM64"
# endif
# if __hppa__
" HP/PA RISC"
# endif
# if __ia64__
" Intel Itanium"
# endif
# if __mips__
" MIPS"
# endif
# if defined(_MIPS_ARCH)
" " _MIPS_ARCH
# endif
# if __mips16
" mips16"
# endif
# if __mips_micromips
" micromips"
# endif
# if __ppc__ || __powerpc__
" PowerPC"
# endif
# if __powerpc64__ || __ppc64__
" PowerPC64"
# endif
# if __sparc__
" SPARC"
# endif
# if defined(__s390__) && !defined(__zarch__) && !defined(__s390x__)
" IBM S/390"
# endif
# if __zarch__ || __s390x__
" IBM z/Arch (S/390x)"
# endif
# if __m68k__
" Motorola 68k"
# endif
# if __ANDROID__
" Android"
# endif
# if __ANDROID_API__
" (API level " ANDROID_API_LEVEL ")"
# endif
# if __FreeBSD__ || __FreeBSD_kernel__
" FreeBSD"
# endif
# if __NetBSD__
" NetBSD"
# endif
# if __OpenBSD__
" OpenBSD"
# endif
# if __DragonFly__
" DragonFly BSD"
# endif
# if defined(__CYGWIN__) && !defined(_WIN64)
" Cygwin32"
# endif
# if defined(__CYGWIN__) && defined(_WIN64)
" Cygwin64"
# endif
# if __GNU__
" GNU"
# endif
# if __gnu_hurd__
" Hurd"
# endif
# if __MACH__
" Mach"
# endif
# if __linux__
" Linux"
# endif
# if __APPLE__ && __MACH__
" Darwin"
# endif
# if __minix__
" Minix"
# endif
# if __QNX__
" QNX"
# endif
# if __svr4__ || __SVR4
" SYSV R4"
# endif
# if (defined(__sun__) || defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))
" Solaris"
# endif
# if (defined(__sun__) || defined(sun) || defined(__sun)) && !defined(__SVR4) && !defined(__svr4__)
" SunOS"
# endif
# if defined(_WIN32) && !defined(_WIN64)
" Windows32"
# endif
# if defined(_WIN32) && defined(_WIN64)
" Windows64"
# endif
# if __MVS__ || __TOS_MVS__
" z/OS"
# endif
# if defined(__GLIBC__) && !defined(__UCLIBC__)
" glibc"
# endif
# if __UCLIBC__
" uclibc"
# endif
# if defined(__linux__) && !defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__ANDROID__) && !defined(__BIONIC__)
" musl"
# endif
//# if _MIPSEL || __MIPSEL__ || __ARMEL__ || __THUMBEL__
// " little-endian"
//# endif
//
//# if _MIPSEB || __MIPSEB__ || __ARMEB__ || __THUMBEB__
// " big-endian"
//# endif
# if __PIE__ || __pie__
" PIE"
# endif
,
*((uint8_t*)&testNumber) == 0x34 ? "little-endian" : "big-endian"
);
}
void printCommonFlags()
{
printf
(
"Common flags:%s\n",""
# ifdef NO_EXTENDED_PRODUCT_LIST
" NO_EXTENDED_PRODUCT_LIST"
# endif // NO_EXTENDED_PRODUCT_LIST
# ifdef NO_BASIC_PRODUCT_LIST
" NO_BASIC_PRODUCT_LIST"
# endif // NO_BASIC_PRODUCT_LIST
# ifdef USE_MSRPC
" USE_MSRPC"
# endif // USE_MSRPC
# ifdef _CRYPTO_OPENSSL
" _CRYPTO_OPENSSL"
# endif // _CRYPTO_OPENSSL
# ifdef _CRYPTO_POLARSSL
" _CRYPTO_POLARSSL"
# endif // _CRYPTO_POLARSSL
# ifdef _CRYPTO_WINDOWS
" _CRYPTO_WINDOWS"
# endif // _CRYPTO_WINDOWS
# if defined(_OPENSSL_SOFTWARE) && defined(_CRYPTO_OPENSSL)
" _OPENSSL_SOFTWARE"
# endif // _OPENSSL_SOFTWARE
# if defined(_USE_AES_FROM_OPENSSL) && defined(_CRYPTO_OPENSSL)
" _USE_AES_FROM_OPENSSL"
# endif // _USE_AES_FROM_OPENSSL
# if defined(_OPENSSL_NO_HMAC) && defined(_CRYPTO_OPENSSL)
" OPENSSL_HMAC=0"
# endif // _OPENSSL_NO_HMAC
# ifdef _PEDANTIC
" _PEDANTIC"
# endif // _PEDANTIC
# ifdef INCLUDE_BETAS
" INCLUDE_BETAS"
# endif // INCLUDE_BETAS
# if __minix__ || defined(NO_TIMEOUT)
" NO_TIMEOUT=1"
# endif // __minix__ || defined(NO_TIMEOUT)
);
}
void printClientFlags()
{
printf
(
"vlmcs flags:%s\n",""
# ifdef NO_DNS
" NO_DNS=1"
# endif
# if !defined(NO_DNS)
# if defined(DNS_PARSER_INTERNAL) && !defined(_WIN32)
" DNS_PARSER=internal"
# else // !defined(DNS_PARSER_INTERNAL) || defined(_WIN32)
" DNS_PARSER=OS"
# endif // !defined(DNS_PARSER_INTERNAL) || defined(_WIN32)
# endif // !defined(NO_DNS)
# if defined(DISPLAY_WIDTH)
" TERMINAL_WIDTH=" DISPLAY_WIDTH
# endif
);
}
void printServerFlags()
{
printf
(
"vlmcsd flags:%s\n",""
# ifdef NO_LOG
" NO_LOG"
# endif // NO_LOG
# ifdef NO_RANDOM_EPID
" NO_RANDOM_EPID"
# endif // NO_RANDOM_EPID
# ifdef NO_INI_FILE
" NO_INI_FILE"
# endif // NO_INI_FILE
# if !defined(NO_INI_FILE) && defined(INI_FILE)
" INI=" INI_FILE
# endif // !defined(NO_INI_FILE)
# ifdef NO_PID_FILE
" NO_PID_FILE"
# endif // NO_PID_FILE
# ifdef NO_USER_SWITCH
" NO_USER_SWITCH"
# endif // NO_USER_SWITCH
# ifdef NO_HELP
" NO_HELP"
# endif // NO_HELP
# ifdef NO_CUSTOM_INTERVALS
" NO_CUSTOM_INTERVALS"
# endif // NO_CUSTOM_INTERVALS
# ifdef NO_SOCKETS
" NO_SOCKETS"
# endif // NO_SOCKETS
# ifdef NO_CL_PIDS
" NO_CL_PIDS"
# endif // NO_CL_PIDS
# ifdef NO_LIMIT
" NO_LIMIT"
# endif // NO_LIMIT
# ifdef NO_SIGHUP
" NO_SIGHUP"
# endif // NO_SIGHUP
# ifdef NO_PROCFS
" NOPROCFS=1"
# endif // NO_PROCFS
# ifdef USE_THREADS
" THREADS=1"
# endif // USE_THREADS
# ifdef USE_AUXV
" AUXV=1"
# endif // USE_AUXV
# if defined(CHILD_HANDLER) || __minix__
" CHILD_HANDLER=1"
# endif // defined(CHILD_HANDLER) || __minix__
# if !defined(NO_SOCKETS) && defined(SIMPLE_SOCKETS)
" SIMPLE_SOCKETS"
# endif // !defined(NO_SOCKETS) && defined(SIMPLE_SOCKETS)
# if (_WIN32 || __CYGWIN__) && (!defined(USE_MSRPC) || defined(SUPPORT_WINE))
" SUPPORT_WINE"
# endif // (_WIN32 || __CYGWIN__) && (!defined(USE_MSRPC) || defined(SUPPORT_WINE))
# if !HAVE_FREEBIND
" NO_FREEBIND"
# endif //!HAVE_FREEBIND
);
}
#endif // NO_VERSION_INFORMATION

View File

@ -6,6 +6,7 @@
#endif // CONFIG #endif // CONFIG
#include CONFIG #include CONFIG
#include <errno.h>
#include "kms.h" #include "kms.h"
typedef int (*PRINTFUNC)(const char *const fmt, ...); typedef int (*PRINTFUNC)(const char *const fmt, ...);
@ -15,6 +16,13 @@ int errorout(const char* fmt, ...);
void logRequestVerbose(const REQUEST *const Request, const PRINTFUNC p); void logRequestVerbose(const REQUEST *const Request, const PRINTFUNC p);
void logResponseVerbose(const char *const ePID, const BYTE *const hwid, const RESPONSE *const response, const PRINTFUNC p); void logResponseVerbose(const char *const ePID, const BYTE *const hwid, const RESPONSE *const response, const PRINTFUNC p);
#ifndef NO_VERSION_INFORMATION
void printPlatform();
void printCommonFlags();
void printServerFlags();
void printClientFlags();
#endif // NO_VERSION_INFORMATION
#ifndef NO_LOG #ifndef NO_LOG
int logger(const char *const fmt, ...); int logger(const char *const fmt, ...);
#endif //NO_LOG #endif //NO_LOG

View File

@ -51,10 +51,14 @@ int_fast8_t logverbose = 0;
#endif // NO_LOG #endif // NO_LOG
#ifndef NO_SOCKETS #ifndef NO_SOCKETS
#ifndef _WIN32
int_fast8_t nodaemon = 0; int_fast8_t nodaemon = 0;
#endif // _WIN32
int_fast8_t InetdMode = 0; int_fast8_t InetdMode = 0;
#else #else
#ifndef _WIN32
int_fast8_t nodaemon = 1; int_fast8_t nodaemon = 1;
#endif // _WIN32
int_fast8_t InetdMode = 1; int_fast8_t InetdMode = 1;
#endif #endif
@ -64,8 +68,12 @@ uint16_t Lcid = 0;
#endif #endif
#ifndef NO_SOCKETS #ifndef NO_SOCKETS
#ifdef SIMPLE_SOCKETS
SOCKET s_server;
#else
SOCKET *SocketList; SOCKET *SocketList;
int numsockets = 0; int numsockets = 0;
#endif
#if !defined(NO_LIMIT) && !__minix__ #if !defined(NO_LIMIT) && !__minix__
#ifndef _WIN32 // Posix #ifndef _WIN32 // Posix
@ -92,6 +100,10 @@ CRITICAL_SECTION logmutex;
#endif // USE_THREADS #endif // USE_THREADS
#endif // NO_LOG #endif // NO_LOG
#if HAVE_FREEBIND
int_fast8_t freebind = FALSE;
#endif // HAVE_FREEBIND

View File

@ -74,10 +74,16 @@ extern const char *const Version;
#define UINT_MAX 4294967295 #define UINT_MAX 4294967295
#endif #endif
#ifdef IS_LIBRARY
#define MESSAGE_BUFFER_SIZE 256
EXTERNC __declspec(EXTERNAL) extern char ErrorMessage[MESSAGE_BUFFER_SIZE];
#endif // IS_LIBRARY
extern int global_argc, multi_argc; extern int global_argc, multi_argc;
extern CARGV global_argv, multi_argv; extern CARGV global_argv, multi_argv;
#ifndef _WIN32
extern int_fast8_t nodaemon; extern int_fast8_t nodaemon;
#endif // _WIN32
extern DWORD VLActivationInterval; extern DWORD VLActivationInterval;
extern DWORD VLRenewalInterval; extern DWORD VLRenewalInterval;
extern int_fast8_t DisconnectImmediately; extern int_fast8_t DisconnectImmediately;
@ -122,8 +128,12 @@ extern uint16_t Lcid;
#endif #endif
#if !defined(NO_SOCKETS) && !defined(USE_MSRPC) #if !defined(NO_SOCKETS) && !defined(USE_MSRPC)
#if defined(SIMPLE_SOCKETS)
extern SOCKET s_server;
#else // !defined(SIMPLE_SOCKETS)
extern SOCKET *SocketList; extern SOCKET *SocketList;
extern int numsockets; extern int numsockets;
#endif // !defined(SIMPLE_SOCKETS)
#if !defined(NO_LIMIT) && !__minix__ #if !defined(NO_LIMIT) && !__minix__
@ -152,5 +162,9 @@ extern CRITICAL_SECTION logmutex;
#endif // USE_THREADS #endif // USE_THREADS
#endif // NO_LOG #endif // NO_LOG
#if HAVE_FREEBIND
extern int_fast8_t freebind;
#endif // HAVE_FREEBIND
#endif // INCLUDED_SHARED_GLOBALS_H #endif // INCLUDED_SHARED_GLOBALS_H

3
strip_binaries Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
find binaries -xdev -name 'vlmcs*' ! -name '*-NetBSD-*' ! -name '*-Windows-*' ! -name '*-cygwin-*' ! -name '*-MacOSX-*' ! -name '*-iOS-*' -exec sstrip -z {} \;

36
types.h
View File

@ -6,13 +6,41 @@
#endif // CONFIG #endif // CONFIG
#include CONFIG #include CONFIG
#define ANDROID_API_LEVEL ANDROID_HELPER1(__ANDROID_API__)
#define ANDROID_HELPER1(s) ANDROID_HELPER2(s)
#define ANDROID_HELPER2(s) #s
#if !defined(_WIN32) && !__CYGWIN__
#define __declspec(x) __attribute__((__visibility__("default")))
#endif
#if !defined(EXTERNAL)
#define EXTERNAL dllimport
#endif
#ifdef __cplusplus
#define EXTERNC extern "C"
#else
#define EXTERNC
#endif
#include <stdlib.h> #include <stdlib.h>
#include <limits.h> #include <limits.h>
#include <stdint.h> #include <stdint.h>
//#ifdef __sun__ #ifdef __ANDROID__
//#include <alloca.h> #include <android/api-level.h>
//#endif #endif // __ANDROID__
#ifndef _WIN32
#include <netinet/in.h>
#endif // _WIN32
#if (IP_BINDANY || IP_FREEBIND || IPV6_BINDANY || IP_NONLOCALOK) && !defined(NO_FREEBIND) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)
#define HAVE_FREEBIND 1
#endif
#ifndef alloca #ifndef alloca
#ifdef __GNUC__ #ifdef __GNUC__
#define alloca(x) __builtin_alloca(x) #define alloca(x) __builtin_alloca(x)
@ -156,6 +184,7 @@ typedef uint8_t ProdListIndex_t;
#endif // USE_MSRPC #endif // USE_MSRPC
#include <windows.h> #include <windows.h>
//#include <VersionHelpers.h>
typedef char* sockopt_t; typedef char* sockopt_t;
@ -184,6 +213,7 @@ typedef char* sockopt_t;
#elif defined(__CYGWIN__) #elif defined(__CYGWIN__)
#include <windows.h> #include <windows.h>
// Resolve conflicts between OpenSSL and MS Crypto API // Resolve conflicts between OpenSSL and MS Crypto API
#ifdef _CRYPTO_OPENSSL #ifdef _CRYPTO_OPENSSL
#undef OCSP_RESPONSE #undef OCSP_RESPONSE

View File

@ -1,5 +1,5 @@
.mso www.tmac .mso www.tmac
.TH VLMCS 1 "February 2015" "Hotbird64" "KMS Activation Manual" .TH VLMCS 1 "May 2016" "Hotbird64" "KMS Activation Manual"
.LO 1 .LO 1
.SH NAME .SH NAME
@ -11,7 +11,7 @@ vlmcs \- a client for testing and/or charging KMS servers
\fItarget\fR can be one of the following: \fItarget\fR can be one of the following:
.RS .RS
.PP .PP
\fIhostname\fR|\fIipaddress\fR[:\fItcp-port\fR] or to query a specific KMS server (example: vlmcs kms.example.com:1688). \fIhostname\fR|\fIipaddress\fR[:\fItcp-port\fR] to query a specific KMS server (example: vlmcs kms.example.com:1688).
.br .br
\fR.\fIdomain\fR to automatically detect KMS servers via DNS for \fIdomain\fR (example: vlmcs .example.com). Please note the dot before \fIdomain\fR. \fR.\fIdomain\fR to automatically detect KMS servers via DNS for \fIdomain\fR (example: vlmcs .example.com). Please note the dot before \fIdomain\fR.
.br .br
@ -44,6 +44,9 @@ can also be used to "charge" a KMS server. A Microsoft KMS server sends correct
.IP "\fB-h\fR or \fB-?" .IP "\fB-h\fR or \fB-?"
Show help. Show help.
.IP "\fB-V\fR"
Displays extended version information. This includes the compiler used to build vlmcs, the intended platform and flags (compile time options) to build vlmcs. If you have the source code of vlmcsd, you can type \fBmake help\fR (or \fBgmake help\fR on systems that do not use the GNU version of \fBmake\fR(1) by default) to see the meaning of those flags.
.IP \fB-x .IP \fB-x
Show valid Show valid
.IR application s .IR application s

View File

@ -11,7 +11,7 @@ SYNOPSIS
target can be one of the following: target can be one of the following:
hostname|ipaddress[:tcp-port] or to query a specific KMS server hostname|ipaddress[:tcp-port] to query a specific KMS server
(example: vlmcs kms.example.com:1688). (example: vlmcs kms.example.com:1688).
.domain to automatically detect KMS servers via DNS for domain .domain to automatically detect KMS servers via DNS for domain
(example: vlmcs .example.com). Please note the dot before (example: vlmcs .example.com). Please note the dot before
@ -52,6 +52,14 @@ OPTIONS
Show help. Show help.
-V Displays extended version information. This includes the com
piler used to build vlmcs, the intended platform and flags (com
pile time options) to build vlmcs. If you have the source code
of vlmcsd, you can type make help (or gmake help on systems that
do not use the GNU version of make(1) by default) to see the
meaning of those flags.
-x Show valid applications that can be used with -l. -x Show valid applications that can be used with -l.
@ -59,44 +67,44 @@ OPTIONS
-v Be verbose. Instead of just displaying the returned ePID and the -v Be verbose. Instead of just displaying the returned ePID and the
HwId (protocol v6 only) vlmcsd shows all details of the query HwId (protocol v6 only) vlmcsd shows all details of the query
and the response. and the response.
-l application -l application
Request activation for a specific application. Valid applica Request activation for a specific application. Valid applica
tions can be displayed by using -x. The default application is tions can be displayed by using -x. The default application is
Windows Vista Business. The list of available applications is Windows Vista Business. The list of available applications is
not complete. You may supply GUIDs with -a, -k and -s to specify not complete. You may supply GUIDs with -a, -k and -s to specify
applications that are not listed with -x. The -l option is used applications that are not listed with -x. The -l option is used
as a shortcut for the most common applications. as a shortcut for the most common applications.
-4, -5 and -6 -4, -5 and -6
Force version 4, 5 or 6 of the KMS protocol. The default is to Force version 4, 5 or 6 of the KMS protocol. The default is to
select a suitable version according to the application selected. select a suitable version according to the application selected.
Plese note that some products (e.g. Office 2013) may use differ Plese note that some products (e.g. Office 2013) may use differ
ent protocols with different versions of Windows. ent protocols with different versions of Windows.
-m Let the client pretend to be a virtual machine. Early versions -m Let the client pretend to be a virtual machine. Early versions
of Microsoft's KMS server did not increase the client count if of Microsoft's KMS server did not increase the client count if
the request came from a virtual machine. Newer versions ignore the request came from a virtual machine. Newer versions ignore
this flag. this flag.
-d Use NetBIOS names instead of DNS names. By default vlmcsd gener -d Use NetBIOS names instead of DNS names. By default vlmcsd gener
ates some random DNS names for each request. If you prefer Net ates some random DNS names for each request. If you prefer Net
BIOS names, you may use -d. A real Microsoft activation client BIOS names, you may use -d. A real Microsoft activation client
uses DNS names or NetBIOS depending on the client name configu uses DNS names or NetBIOS depending on the client name configu
ration. KMS servers treat the workstation name as a comment that ration. KMS servers treat the workstation name as a comment that
affects logging only. Clients will be identified by a GUID that affects logging only. Clients will be identified by a GUID that
can be specified using -c. -d has no effect if you also specify can be specified using -c. -d has no effect if you also specify
-w. -w.
-a application-guid -a application-guid
Send requests with a specific application-guid. There are cur Send requests with a specific application-guid. There are cur
rently only three known valid application-guids: rently only three known valid application-guids:
@ -105,91 +113,91 @@ OPTIONS
0ff1ce15-a989-479d-af46-f275c6370663 (Office 2013) 0ff1ce15-a989-479d-af46-f275c6370663 (Office 2013)
A Microsoft KMS server uses these GUIDs to have seperate coun A Microsoft KMS server uses these GUIDs to have seperate coun
ters for the already activated clients. A client that does not ters for the already activated clients. A client that does not
contact the KMS server within 30 days will be deleted from the contact the KMS server within 30 days will be deleted from the
database. Emulated KMS servers are always fully charged. database. Emulated KMS servers are always fully charged.
-k kms-guid -k kms-guid
Send requests with a specific kms-guid. A Microsoft KMS server Send requests with a specific kms-guid. A Microsoft KMS server
uses these GUIDs as a product id to decide whether to grant uses these GUIDs as a product id to decide whether to grant
activation or not. A list of current kms-guids can be found in activation or not. A list of current kms-guids can be found in
kms.c (table KmsIdList). Emulated KMS servers grant activation kms.c (table KmsIdList). Emulated KMS servers grant activation
unconditionally and do not check the kms-guid. unconditionally and do not check the kms-guid.
-s activation-guid -s activation-guid
The activation-guid defines the actual product, e.g. "Windows The activation-guid defines the actual product, e.g. "Windows
8.1 Professional WMC KMSCLIENT edition". A activation-guid maps 8.1 Professional WMC KMSCLIENT edition". A activation-guid maps
1:1 to a product key. However, neither a Microsoft KMS server 1:1 to a product key. However, neither a Microsoft KMS server
nor emulated servers check this id. The activation-guid is use nor emulated servers check this id. The activation-guid is use
ful in logging to get a specific product description like "Win ful in logging to get a specific product description like "Win
dows 8.1 Professional WMC". A list of current activation-guids dows 8.1 Professional WMC". A list of current activation-guids
can be found in kms.c (table ExtendedProductList). can be found in kms.c (table ExtendedProductList).
-n requests -n requests
Send requests requests to the server. The default is to send at Send requests requests to the server. The default is to send at
least one request and enough subsequent requests that the server least one request and enough subsequent requests that the server
is fully charged afterwards for the application-guid you is fully charged afterwards for the application-guid you
selected (explicitly with -a or implicitly by using -l). selected (explicitly with -a or implicitly by using -l).
-T Causes to use a new TCP connection for each request if multiple -T Causes to use a new TCP connection for each request if multiple
requests are sent with vlmcsd. This is useful when you want to requests are sent with vlmcsd. This is useful when you want to
test an emulated KMS server whether it suffers from memory test an emulated KMS server whether it suffers from memory
leaks. To test for memory leaks use -n with a large number of leaks. To test for memory leaks use -n with a large number of
requests (> 100000) and then test twice (with and without -T). requests (> 100000) and then test twice (with and without -T).
This option may become neccessary for future versions of Micro This option may become neccessary for future versions of Micro
soft's KMS server because multiple requests with different soft's KMS server because multiple requests with different
clients-guids for the same kms-id-guid are impossible in a real clients-guids for the same kms-id-guid are impossible in a real
KMS szenario over the same TCP connection. KMS szenario over the same TCP connection.
-c client-machine-guid -c client-machine-guid
Normally vlmcs generates a random client-machine-guid for each Normally vlmcs generates a random client-machine-guid for each
request. By using this option you can specify a fixed client- request. By using this option you can specify a fixed client-
machine-guid This causes a Microsoft KMS not to increment its machine-guid This causes a Microsoft KMS not to increment its
client count because it receives multiple requests for the same client count because it receives multiple requests for the same
client. Thus do not use -c if you want to charge a real KMS client. Thus do not use -c if you want to charge a real KMS
server. server.
-o previous-client-machine-guid -o previous-client-machine-guid
If the client-machine-guid changes for some reason, the real KMS If the client-machine-guid changes for some reason, the real KMS
client stores a previous-client-machine-guid which is sent to client stores a previous-client-machine-guid which is sent to
the KMS server. This happens rarely and usually the KMS server. This happens rarely and usually
00000000-0000-0000-0000-000000000000 is used. You can use -o to 00000000-0000-0000-0000-000000000000 is used. You can use -o to
specify a different previous-client-machine-guid. specify a different previous-client-machine-guid.
-G filename -G filename
Grabs ePIDs and HWIDs from a KMS server and writes the informa Grabs ePIDs and HWIDs from a KMS server and writes the informa
tion to filename in format suitable to be used as a configura tion to filename in format suitable to be used as a configura
tion file (aka ini file) for vlmcsd(8). This is especially use tion file (aka ini file) for vlmcsd(8). This is especially use
ful if you have access to a genuine KMS server and want to use ful if you have access to a genuine KMS server and want to use
the same data with vlmcsd(8). the same data with vlmcsd(8).
If filename does not exist, it will be created. If you specify If filename does not exist, it will be created. If you specify
an existing filename, it will be updated to use the information an existing filename, it will be updated to use the information
received from the remote KMS server and a backup filename~ will received from the remote KMS server and a backup filename~ will
be created. be created.
-G cannot be used with -l, -4, -5, -6, -a, -s, -k, -r and -n -G cannot be used with -l, -4, -5, -6, -a, -s, -k, -r and -n
-w workstation-name -w workstation-name
Send requests with a specific workstation-name. This disables Send requests with a specific workstation-name. This disables
the random generator for the workstation name. Since it is a the random generator for the workstation name. Since it is a
comment only, this option does not have much effect. comment only, this option does not have much effect.
-r required-client-count -r required-client-count
Also known as the "N count policy". Tells the KMS server that Also known as the "N count policy". Tells the KMS server that
successful activation requires required-client-count clients. successful activation requires required-client-count clients.
The default is the required-client-count that the product would The default is the required-client-count that the product would
need if the request was a real activation. A Microsoft KMS need if the request was a real activation. A Microsoft KMS
server counts clients up to the double amount what was specified server counts clients up to the double amount what was specified
with -r. This option can be used to "overcharge" a Microsoft KMS with -r. This option can be used to "overcharge" a Microsoft KMS
server. server.
@ -197,57 +205,57 @@ OPTIONS
-t status -t status
Reports a specific license status to the KMS server. status is a Reports a specific license status to the KMS server. status is a
number that can be from 0 to 6. 0=unlicensed, 1=licensed, 2=OOB number that can be from 0 to 6. 0=unlicensed, 1=licensed, 2=OOB
grace, 3=OOT grace, 4=Non-genuinue grace, 5=notification, grace, 3=OOT grace, 4=Non-genuinue grace, 5=notification,
6=extended grace. Refer to TechNet ⟨http:// 6=extended grace. Refer to TechNet ⟨http://
technet.microsoft.com/en-us/library/ff686879.aspx#_Toc257201371⟩ technet.microsoft.com/en-us/library/ff686879.aspx#_Toc257201371⟩
for more information. A Microsoft KMS server collects this for more information. A Microsoft KMS server collects this
information for statistics only. information for statistics only.
-g binding-expiration -g binding-expiration
This tells the KMS server how long a client will stay in its This tells the KMS server how long a client will stay in its
current license status. This can be the remaining OOB time (the current license status. This can be the remaining OOB time (the
grace peroid that is granted between installation of a product grace peroid that is granted between installation of a product
and when activation is actuall required) or the remaining time and when activation is actuall required) or the remaining time
when KMS activation must be renewed. binding-expiration is when KMS activation must be renewed. binding-expiration is
specified in minutes. A Microsoft KMS server apparantly does not specified in minutes. A Microsoft KMS server apparantly does not
use this information. use this information.
-i protocol-version -i protocol-version
Force the use of Internet protocol protocol-version. Allowed Force the use of Internet protocol protocol-version. Allowed
values are 4 (IPv4) and 6 (IPv6). This option is useful only if values are 4 (IPv4) and 6 (IPv6). This option is useful only if
you specfiy a hostname and not an ip-address on the command you specfiy a hostname and not an ip-address on the command
line. line.
-p Do not set the RPC_PF_MULTIPLEX flag in the RPC bind request. -p Do not set the RPC_PF_MULTIPLEX flag in the RPC bind request.
This can be used to test if the KMS server uses the same setting This can be used to test if the KMS server uses the same setting
of this flag in the RPC bind respone. Some KMS emulators don't of this flag in the RPC bind respone. Some KMS emulators don't
set this correctly. set this correctly.
-N0 and -N1 -N0 and -N1
Disables (-N0) or enables (-N1) the NDR64 transfer syntax in the Disables (-N0) or enables (-N1) the NDR64 transfer syntax in the
RPC protocol. Disable NDR64 only in case of problems. If NDR64 RPC protocol. Disable NDR64 only in case of problems. If NDR64
is not used, vlmcs cannot detect many RPC protocol errors in KMS is not used, vlmcs cannot detect many RPC protocol errors in KMS
emulators. If you want to test whether a KMS emulator fully sup emulators. If you want to test whether a KMS emulator fully sup
ports NDR64, you must use the -n option to send at least two ports NDR64, you must use the -n option to send at least two
requests. This is because Microsoft's client always sends the requests. This is because Microsoft's client always sends the
first request using NDR32 syntax and subsequent requests using first request using NDR32 syntax and subsequent requests using
NDR64 syntax. NDR64 syntax.
-B0 and -B1 -B0 and -B1
Disables (-B0) or enables (-B1) bind time feature negotiation Disables (-B0) or enables (-B1) bind time feature negotiation
(BTFN) in the RPC protocol. Disable BTFN only in case of prob (BTFN) in the RPC protocol. Disable BTFN only in case of prob
lems. If BTFN is not used, vlmcs cannot detect many RPC protocol lems. If BTFN is not used, vlmcs cannot detect many RPC protocol
errors in KMS emulators. errors in KMS emulators.
Options that do not require an argument can be specified together with Options that do not require an argument can be specified together with
a single dash, e.g. vlmcs -6mvT. If you specify an option more than a single dash, e.g. vlmcs -6mvT. If you specify an option more than
once, the last occurence will be in effect. once, the last occurence will be in effect.
@ -257,34 +265,34 @@ FILES
EXAMPLES EXAMPLES
vlmcs kms.example.com vlmcs kms.example.com
Request activation for Windows Vista using v4 protocol from Request activation for Windows Vista using v4 protocol from
kms.example.com. Repeat activation requests until server is kms.example.com. Repeat activation requests until server is
charged for all Windows products. charged for all Windows products.
vlmcs - vlmcs -
Request activation for Windows Vista using v4 protocol from a Request activation for Windows Vista using v4 protocol from a
KMS server that is published via DNS for the current domain. KMS server that is published via DNS for the current domain.
vlmcs .example.com vlmcs .example.com
Request activation for Windows Vista using v4 protocol from a Request activation for Windows Vista using v4 protocol from a
KMS server that is published via DNS for domain example.com. KMS server that is published via DNS for domain example.com.
vlmcs -6 -l Office2013 -v -n 1 vlmcs -6 -l Office2013 -v -n 1
Request exactly one activation for Office2013 using v6 protocol Request exactly one activation for Office2013 using v6 protocol
from localhost. Display verbose results. from localhost. Display verbose results.
vlmcs kms.bigcompany.com -G /etc/vlmcsd.ini vlmcs kms.bigcompany.com -G /etc/vlmcsd.ini
Get ePIDs and HWIDs from kms.bigcompany.com and create/update Get ePIDs and HWIDs from kms.bigcompany.com and create/update
/etc/vlmcsd.ini accordingly. /etc/vlmcsd.ini accordingly.
BUGS BUGS
Some platforms (e.g. Solaris) may have a man(7) system that does not Some platforms (e.g. Solaris) may have a man(7) system that does not
handle URLs. URLs may be omitted in the documentation on those plat handle URLs. URLs may be omitted in the documentation on those plat
forms. Cygwin, Linux, FreeBSD and Mac OS X are known to work correctly. forms. Cygwin, Linux, FreeBSD and Mac OS X are known to work correctly.
@ -293,7 +301,7 @@ AUTHOR
CREDITS CREDITS
Thanks to CODYQX4, crony12, deagles, DougQaid, eIcn, mikmik38, nos Thanks to CODYQX4, crony12, deagles, DougQaid, eIcn, mikmik38, nos
ferati87, qad, Ratiborus, vityan666, ... ferati87, qad, Ratiborus, vityan666, ...
@ -302,4 +310,4 @@ SEE ALSO
Hotbird64 February 2015 VLMCS(1) Hotbird64 May 2016 VLMCS(1)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 --> <!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Tue Mar 8 00:06:21 2016 --> <!-- CreationDate: Sun Jun 5 14:31:10 2016 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
@ -55,7 +55,7 @@ can be one of the following:</p>
<p style="margin-left:22%; margin-top: 1em"><i>hostname</i>|<i>ipaddress</i>[:<i>tcp-port</i>] <p style="margin-left:22%; margin-top: 1em"><i>hostname</i>|<i>ipaddress</i>[:<i>tcp-port</i>]
or to query a specific KMS server (example: vlmcs to query a specific KMS server (example: vlmcs
kms.example.com:1688). <br> kms.example.com:1688). <br>
.<i>domain</i> to automatically detect KMS servers via DNS .<i>domain</i> to automatically detect KMS servers via DNS
for <i>domain</i> (example: vlmcs .example.com). Please note for <i>domain</i> (example: vlmcs .example.com). Please note
@ -121,6 +121,23 @@ server in a home environment.</p>
<td width="3%"> <td width="3%">
<p><b>-V</b></p></td>
<td width="8%"></td>
<td width="78%">
<p>Displays extended version information. This includes the
compiler used to build vlmcs, the intended platform and
flags (compile time options) to build vlmcs. If you have the
source code of vlmcsd, you can type <b>make help</b> (or
<b>gmake help</b> on systems that do not use the GNU version
of <b>make</b>(1) by default) to see the meaning of those
flags.</p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p><b>-x</b></p></td> <p><b>-x</b></p></td>
<td width="8%"></td> <td width="8%"></td>
<td width="78%"> <td width="78%">

Binary file not shown.

View File

@ -11,7 +11,7 @@ SYNOPSIS
target can be one of the following: target can be one of the following:
hostname|ipaddress[:tcp-port] or to query a specific KMS server hostname|ipaddress[:tcp-port] to query a specific KMS server
(example: vlmcs kms.example.com:1688). (example: vlmcs kms.example.com:1688).
.domain to automatically detect KMS servers via DNS for domain .domain to automatically detect KMS servers via DNS for domain
(example: vlmcs .example.com). Please note the dot before (example: vlmcs .example.com). Please note the dot before
@ -52,6 +52,14 @@ OPTIONS
Show help. Show help.
-V Displays extended version information. This includes the com
piler used to build vlmcs, the intended platform and flags (com
pile time options) to build vlmcs. If you have the source code
of vlmcsd, you can type make help (or gmake help on systems that
do not use the GNU version of make(1) by default) to see the
meaning of those flags.
-x Show valid applications that can be used with -l. -x Show valid applications that can be used with -l.
@ -59,44 +67,44 @@ OPTIONS
-v Be verbose. Instead of just displaying the returned ePID and the -v Be verbose. Instead of just displaying the returned ePID and the
HwId (protocol v6 only) vlmcsd shows all details of the query HwId (protocol v6 only) vlmcsd shows all details of the query
and the response. and the response.
-l application -l application
Request activation for a specific application. Valid applica Request activation for a specific application. Valid applica
tions can be displayed by using -x. The default application is tions can be displayed by using -x. The default application is
Windows Vista Business. The list of available applications is Windows Vista Business. The list of available applications is
not complete. You may supply GUIDs with -a, -k and -s to specify not complete. You may supply GUIDs with -a, -k and -s to specify
applications that are not listed with -x. The -l option is used applications that are not listed with -x. The -l option is used
as a shortcut for the most common applications. as a shortcut for the most common applications.
-4, -5 and -6 -4, -5 and -6
Force version 4, 5 or 6 of the KMS protocol. The default is to Force version 4, 5 or 6 of the KMS protocol. The default is to
select a suitable version according to the application selected. select a suitable version according to the application selected.
Plese note that some products (e.g. Office 2013) may use differ Plese note that some products (e.g. Office 2013) may use differ
ent protocols with different versions of Windows. ent protocols with different versions of Windows.
-m Let the client pretend to be a virtual machine. Early versions -m Let the client pretend to be a virtual machine. Early versions
of Microsoft's KMS server did not increase the client count if of Microsoft's KMS server did not increase the client count if
the request came from a virtual machine. Newer versions ignore the request came from a virtual machine. Newer versions ignore
this flag. this flag.
-d Use NetBIOS names instead of DNS names. By default vlmcsd gener -d Use NetBIOS names instead of DNS names. By default vlmcsd gener
ates some random DNS names for each request. If you prefer Net ates some random DNS names for each request. If you prefer Net
BIOS names, you may use -d. A real Microsoft activation client BIOS names, you may use -d. A real Microsoft activation client
uses DNS names or NetBIOS depending on the client name configu uses DNS names or NetBIOS depending on the client name configu
ration. KMS servers treat the workstation name as a comment that ration. KMS servers treat the workstation name as a comment that
affects logging only. Clients will be identified by a GUID that affects logging only. Clients will be identified by a GUID that
can be specified using -c. -d has no effect if you also specify can be specified using -c. -d has no effect if you also specify
-w. -w.
-a application-guid -a application-guid
Send requests with a specific application-guid. There are cur Send requests with a specific application-guid. There are cur
rently only three known valid application-guids: rently only three known valid application-guids:
@ -105,91 +113,91 @@ OPTIONS
0ff1ce15-a989-479d-af46-f275c6370663 (Office 2013) 0ff1ce15-a989-479d-af46-f275c6370663 (Office 2013)
A Microsoft KMS server uses these GUIDs to have seperate coun A Microsoft KMS server uses these GUIDs to have seperate coun
ters for the already activated clients. A client that does not ters for the already activated clients. A client that does not
contact the KMS server within 30 days will be deleted from the contact the KMS server within 30 days will be deleted from the
database. Emulated KMS servers are always fully charged. database. Emulated KMS servers are always fully charged.
-k kms-guid -k kms-guid
Send requests with a specific kms-guid. A Microsoft KMS server Send requests with a specific kms-guid. A Microsoft KMS server
uses these GUIDs as a product id to decide whether to grant uses these GUIDs as a product id to decide whether to grant
activation or not. A list of current kms-guids can be found in activation or not. A list of current kms-guids can be found in
kms.c (table KmsIdList). Emulated KMS servers grant activation kms.c (table KmsIdList). Emulated KMS servers grant activation
unconditionally and do not check the kms-guid. unconditionally and do not check the kms-guid.
-s activation-guid -s activation-guid
The activation-guid defines the actual product, e.g. "Windows The activation-guid defines the actual product, e.g. "Windows
8.1 Professional WMC KMSCLIENT edition". A activation-guid maps 8.1 Professional WMC KMSCLIENT edition". A activation-guid maps
1:1 to a product key. However, neither a Microsoft KMS server 1:1 to a product key. However, neither a Microsoft KMS server
nor emulated servers check this id. The activation-guid is use nor emulated servers check this id. The activation-guid is use
ful in logging to get a specific product description like "Win ful in logging to get a specific product description like "Win
dows 8.1 Professional WMC". A list of current activation-guids dows 8.1 Professional WMC". A list of current activation-guids
can be found in kms.c (table ExtendedProductList). can be found in kms.c (table ExtendedProductList).
-n requests -n requests
Send requests requests to the server. The default is to send at Send requests requests to the server. The default is to send at
least one request and enough subsequent requests that the server least one request and enough subsequent requests that the server
is fully charged afterwards for the application-guid you is fully charged afterwards for the application-guid you
selected (explicitly with -a or implicitly by using -l). selected (explicitly with -a or implicitly by using -l).
-T Causes to use a new TCP connection for each request if multiple -T Causes to use a new TCP connection for each request if multiple
requests are sent with vlmcsd. This is useful when you want to requests are sent with vlmcsd. This is useful when you want to
test an emulated KMS server whether it suffers from memory test an emulated KMS server whether it suffers from memory
leaks. To test for memory leaks use -n with a large number of leaks. To test for memory leaks use -n with a large number of
requests (> 100000) and then test twice (with and without -T). requests (> 100000) and then test twice (with and without -T).
This option may become neccessary for future versions of Micro This option may become neccessary for future versions of Micro
soft's KMS server because multiple requests with different soft's KMS server because multiple requests with different
clients-guids for the same kms-id-guid are impossible in a real clients-guids for the same kms-id-guid are impossible in a real
KMS szenario over the same TCP connection. KMS szenario over the same TCP connection.
-c client-machine-guid -c client-machine-guid
Normally vlmcs generates a random client-machine-guid for each Normally vlmcs generates a random client-machine-guid for each
request. By using this option you can specify a fixed client- request. By using this option you can specify a fixed client-
machine-guid This causes a Microsoft KMS not to increment its machine-guid This causes a Microsoft KMS not to increment its
client count because it receives multiple requests for the same client count because it receives multiple requests for the same
client. Thus do not use -c if you want to charge a real KMS client. Thus do not use -c if you want to charge a real KMS
server. server.
-o previous-client-machine-guid -o previous-client-machine-guid
If the client-machine-guid changes for some reason, the real KMS If the client-machine-guid changes for some reason, the real KMS
client stores a previous-client-machine-guid which is sent to client stores a previous-client-machine-guid which is sent to
the KMS server. This happens rarely and usually the KMS server. This happens rarely and usually
00000000-0000-0000-0000-000000000000 is used. You can use -o to 00000000-0000-0000-0000-000000000000 is used. You can use -o to
specify a different previous-client-machine-guid. specify a different previous-client-machine-guid.
-G filename -G filename
Grabs ePIDs and HWIDs from a KMS server and writes the informa Grabs ePIDs and HWIDs from a KMS server and writes the informa
tion to filename in format suitable to be used as a configura tion to filename in format suitable to be used as a configura
tion file (aka ini file) for vlmcsd(8). This is especially use tion file (aka ini file) for vlmcsd(8). This is especially use
ful if you have access to a genuine KMS server and want to use ful if you have access to a genuine KMS server and want to use
the same data with vlmcsd(8). the same data with vlmcsd(8).
If filename does not exist, it will be created. If you specify If filename does not exist, it will be created. If you specify
an existing filename, it will be updated to use the information an existing filename, it will be updated to use the information
received from the remote KMS server and a backup filename~ will received from the remote KMS server and a backup filename~ will
be created. be created.
-G cannot be used with -l, -4, -5, -6, -a, -s, -k, -r and -n -G cannot be used with -l, -4, -5, -6, -a, -s, -k, -r and -n
-w workstation-name -w workstation-name
Send requests with a specific workstation-name. This disables Send requests with a specific workstation-name. This disables
the random generator for the workstation name. Since it is a the random generator for the workstation name. Since it is a
comment only, this option does not have much effect. comment only, this option does not have much effect.
-r required-client-count -r required-client-count
Also known as the "N count policy". Tells the KMS server that Also known as the "N count policy". Tells the KMS server that
successful activation requires required-client-count clients. successful activation requires required-client-count clients.
The default is the required-client-count that the product would The default is the required-client-count that the product would
need if the request was a real activation. A Microsoft KMS need if the request was a real activation. A Microsoft KMS
server counts clients up to the double amount what was specified server counts clients up to the double amount what was specified
with -r. This option can be used to "overcharge" a Microsoft KMS with -r. This option can be used to "overcharge" a Microsoft KMS
server. server.
@ -197,57 +205,57 @@ OPTIONS
-t status -t status
Reports a specific license status to the KMS server. status is a Reports a specific license status to the KMS server. status is a
number that can be from 0 to 6. 0=unlicensed, 1=licensed, 2=OOB number that can be from 0 to 6. 0=unlicensed, 1=licensed, 2=OOB
grace, 3=OOT grace, 4=Non-genuinue grace, 5=notification, grace, 3=OOT grace, 4=Non-genuinue grace, 5=notification,
6=extended grace. Refer to TechNet ⟨http:// 6=extended grace. Refer to TechNet ⟨http://
technet.microsoft.com/en-us/library/ff686879.aspx#_Toc257201371⟩ technet.microsoft.com/en-us/library/ff686879.aspx#_Toc257201371⟩
for more information. A Microsoft KMS server collects this for more information. A Microsoft KMS server collects this
information for statistics only. information for statistics only.
-g binding-expiration -g binding-expiration
This tells the KMS server how long a client will stay in its This tells the KMS server how long a client will stay in its
current license status. This can be the remaining OOB time (the current license status. This can be the remaining OOB time (the
grace peroid that is granted between installation of a product grace peroid that is granted between installation of a product
and when activation is actuall required) or the remaining time and when activation is actuall required) or the remaining time
when KMS activation must be renewed. binding-expiration is when KMS activation must be renewed. binding-expiration is
specified in minutes. A Microsoft KMS server apparantly does not specified in minutes. A Microsoft KMS server apparantly does not
use this information. use this information.
-i protocol-version -i protocol-version
Force the use of Internet protocol protocol-version. Allowed Force the use of Internet protocol protocol-version. Allowed
values are 4 (IPv4) and 6 (IPv6). This option is useful only if values are 4 (IPv4) and 6 (IPv6). This option is useful only if
you specfiy a hostname and not an ip-address on the command you specfiy a hostname and not an ip-address on the command
line. line.
-p Do not set the RPC_PF_MULTIPLEX flag in the RPC bind request. -p Do not set the RPC_PF_MULTIPLEX flag in the RPC bind request.
This can be used to test if the KMS server uses the same setting This can be used to test if the KMS server uses the same setting
of this flag in the RPC bind respone. Some KMS emulators don't of this flag in the RPC bind respone. Some KMS emulators don't
set this correctly. set this correctly.
-N0 and -N1 -N0 and -N1
Disables (-N0) or enables (-N1) the NDR64 transfer syntax in the Disables (-N0) or enables (-N1) the NDR64 transfer syntax in the
RPC protocol. Disable NDR64 only in case of problems. If NDR64 RPC protocol. Disable NDR64 only in case of problems. If NDR64
is not used, vlmcs cannot detect many RPC protocol errors in KMS is not used, vlmcs cannot detect many RPC protocol errors in KMS
emulators. If you want to test whether a KMS emulator fully sup emulators. If you want to test whether a KMS emulator fully sup
ports NDR64, you must use the -n option to send at least two ports NDR64, you must use the -n option to send at least two
requests. This is because Microsoft's client always sends the requests. This is because Microsoft's client always sends the
first request using NDR32 syntax and subsequent requests using first request using NDR32 syntax and subsequent requests using
NDR64 syntax. NDR64 syntax.
-B0 and -B1 -B0 and -B1
Disables (-B0) or enables (-B1) bind time feature negotiation Disables (-B0) or enables (-B1) bind time feature negotiation
(BTFN) in the RPC protocol. Disable BTFN only in case of prob (BTFN) in the RPC protocol. Disable BTFN only in case of prob
lems. If BTFN is not used, vlmcs cannot detect many RPC protocol lems. If BTFN is not used, vlmcs cannot detect many RPC protocol
errors in KMS emulators. errors in KMS emulators.
Options that do not require an argument can be specified together with Options that do not require an argument can be specified together with
a single dash, e.g. vlmcs -6mvT. If you specify an option more than a single dash, e.g. vlmcs -6mvT. If you specify an option more than
once, the last occurence will be in effect. once, the last occurence will be in effect.
@ -257,34 +265,34 @@ FILES
EXAMPLES EXAMPLES
vlmcs kms.example.com vlmcs kms.example.com
Request activation for Windows Vista using v4 protocol from Request activation for Windows Vista using v4 protocol from
kms.example.com. Repeat activation requests until server is kms.example.com. Repeat activation requests until server is
charged for all Windows products. charged for all Windows products.
vlmcs - vlmcs -
Request activation for Windows Vista using v4 protocol from a Request activation for Windows Vista using v4 protocol from a
KMS server that is published via DNS for the current domain. KMS server that is published via DNS for the current domain.
vlmcs .example.com vlmcs .example.com
Request activation for Windows Vista using v4 protocol from a Request activation for Windows Vista using v4 protocol from a
KMS server that is published via DNS for domain example.com. KMS server that is published via DNS for domain example.com.
vlmcs -6 -l Office2013 -v -n 1 vlmcs -6 -l Office2013 -v -n 1
Request exactly one activation for Office2013 using v6 protocol Request exactly one activation for Office2013 using v6 protocol
from localhost. Display verbose results. from localhost. Display verbose results.
vlmcs kms.bigcompany.com -G /etc/vlmcsd.ini vlmcs kms.bigcompany.com -G /etc/vlmcsd.ini
Get ePIDs and HWIDs from kms.bigcompany.com and create/update Get ePIDs and HWIDs from kms.bigcompany.com and create/update
/etc/vlmcsd.ini accordingly. /etc/vlmcsd.ini accordingly.
BUGS BUGS
Some platforms (e.g. Solaris) may have a man(7) system that does not Some platforms (e.g. Solaris) may have a man(7) system that does not
handle URLs. URLs may be omitted in the documentation on those plat handle URLs. URLs may be omitted in the documentation on those plat
forms. Cygwin, Linux, FreeBSD and Mac OS X are known to work correctly. forms. Cygwin, Linux, FreeBSD and Mac OS X are known to work correctly.
@ -293,7 +301,7 @@ AUTHOR
CREDITS CREDITS
Thanks to CODYQX4, crony12, deagles, DougQaid, eIcn, mikmik38, nos Thanks to CODYQX4, crony12, deagles, DougQaid, eIcn, mikmik38, nos
ferati87, qad, Ratiborus, vityan666, ... ferati87, qad, Ratiborus, vityan666, ...
@ -302,4 +310,4 @@ SEE ALSO
Hotbird64 February 2015 VLMCS(1) Hotbird64 May 2016 VLMCS(1)

49
vlmcs.c
View File

@ -46,7 +46,10 @@ static void CreateRequestBase(REQUEST *Request);
// KMS Parameters // KMS Parameters
#ifndef NO_VERBOSE_LOG
static int_fast8_t verbose = FALSE; static int_fast8_t verbose = FALSE;
#endif
static int_fast8_t VMInfo = FALSE; static int_fast8_t VMInfo = FALSE;
static int_fast8_t dnsnames = TRUE; static int_fast8_t dnsnames = TRUE;
static int FixedRequests = 0; static int FixedRequests = 0;
@ -160,7 +163,9 @@ __noreturn static void clientUsage(const char* const programName)
"Options:\n\n" "Options:\n\n"
# ifndef NO_VERBOSE_LOG
" -v Be verbose\n" " -v Be verbose\n"
# endif
" -l <app>\n" " -l <app>\n"
" -4 Force V4 protocol\n" " -4 Force V4 protocol\n"
" -5 Force V5 protocol\n" " -5 Force V5 protocol\n"
@ -170,7 +175,8 @@ __noreturn static void clientUsage(const char* const programName)
# endif // USE_MSRPC # endif // USE_MSRPC
" -e Show some valid examples\n" " -e Show some valid examples\n"
" -x Show valid Apps\n" " -x Show valid Apps\n"
" -d no DNS names, use Netbios names (no effect if -w is used)\n\n" " -d no DNS names, use Netbios names (no effect if -w is used)\n"
" -V show version information and exit\n\n"
"Advanced options:\n\n" "Advanced options:\n\n"
@ -420,7 +426,7 @@ static BOOL findLicensePackByName(const char* const name, LicensePack* const lp)
#endif // Both Lists are available #endif // Both Lists are available
} }
static const char* const client_optstring = "+N:B:i:l:a:s:k:c:w:r:n:t:g:G:o:pPTv456mexd"; static const char* const client_optstring = "+N:B:i:l:a:s:k:c:w:r:n:t:g:G:o:pPTv456mexdV";
//First pass. We handle only "-l". Since -a -k -s -4 -5 and -6 are exceptions to -l, we process -l first //First pass. We handle only "-l". Since -a -k -s -4 -5 and -6 are exceptions to -l, we process -l first
@ -584,11 +590,15 @@ static void parseCommandLinePass2(const char *const programName, const int argc,
dnsnames = FALSE; dnsnames = FALSE;
break; break;
# ifndef NO_VERBOSE_LOG
case 'v': // Be verbose case 'v': // Be verbose
verbose = TRUE; verbose = TRUE;
break; break;
# endif // NO_VERBOSE_LOG
case 'm': // Pretend to be a virtual machine case 'm': // Pretend to be a virtual machine
VMInfo = TRUE; VMInfo = TRUE;
@ -623,6 +633,21 @@ static void parseCommandLinePass2(const char *const programName, const int argc,
incompatibleOptions |= VLMCS_OPTION_NO_GRAB_INI; incompatibleOptions |= VLMCS_OPTION_NO_GRAB_INI;
break; break;
# ifndef NO_VERSION_INFORMATION
case 'V':
# if defined(__s390__) && !defined(__zarch__) && !defined(__s390x__)
printf("vlmcs %s %i-bit\n", Version, sizeof(void*) == 4 ? 31 : (int)sizeof(void*) << 3);
# else
printf("vlmcs %s %i-bit\n", Version, (int)sizeof(void*) << 3);
# endif // defined(__s390__) && !defined(__zarch__) && !defined(__s390x__)
printPlatform();
printCommonFlags();
printClientFlags();
exit(0);
# endif // NO_VERSION_INFORMATION
default: default:
clientUsage(programName); clientUsage(programName);
} }
@ -651,8 +676,10 @@ static void checkRpcLevel(const REQUEST* request, RESPONSE* response)
if (UseRpcBTFN && UseRpcNDR64 && RpcFlags.HasNDR64 && !RpcFlags.HasBTFN) if (UseRpcBTFN && UseRpcNDR64 && RpcFlags.HasNDR64 && !RpcFlags.HasBTFN)
errorout("\nWARNING: Server's RPC protocol has NDR64 but no BTFN.\n"); errorout("\nWARNING: Server's RPC protocol has NDR64 but no BTFN.\n");
# ifndef NO_BASIC_PRODUCT_LIST
if (!IsEqualGuidLEHE(&request->KMSID, &ProductList[15].guid) && UseRpcBTFN && !RpcFlags.HasBTFN) if (!IsEqualGuidLEHE(&request->KMSID, &ProductList[15].guid) && UseRpcBTFN && !RpcFlags.HasBTFN)
errorout("\nWARNING: A server with pre-Vista RPC activated a product other than Office 2010.\n"); errorout("\nWARNING: A server with pre-Vista RPC activated a product other than Office 2010.\n");
# endif // NO_BASIC_PRODUCT_LIST
} }
#endif // USE_MSRPC #endif // USE_MSRPC
@ -690,7 +717,9 @@ static void displayResponse(const RESPONSE_RESULT result, const REQUEST* request
} }
// Read KMSPID from Response // Read KMSPID from Response
# ifndef NO_VERBOSE_LOG
if (!verbose) if (!verbose)
# endif // NO_VERBOSE_LOG
{ {
printf(" -> %s", ePID); printf(" -> %s", ePID);
@ -705,6 +734,7 @@ static void displayResponse(const RESPONSE_RESULT result, const REQUEST* request
printf("\n"); printf("\n");
} }
# ifndef NO_VERBOSE_LOG
else else
{ {
printf( printf(
@ -715,6 +745,7 @@ static void displayResponse(const RESPONSE_RESULT result, const REQUEST* request
logResponseVerbose(ePID, hwid, response, &printf); logResponseVerbose(ePID, hwid, response, &printf);
printf("\n"); printf("\n");
} }
# endif // NO_VERBOSE_LOG
} }
@ -760,6 +791,7 @@ static void connectRpc(RpcCtx *s)
if (!NoSrvRecordPriority) sortSrvRecords(serverlist, numServers); if (!NoSrvRecordPriority) sortSrvRecords(serverlist, numServers);
# ifndef NO_VERBOSE_LOG
if (verbose /*&& !ServerListAlreadyPrinted*/) if (verbose /*&& !ServerListAlreadyPrinted*/)
{ {
for (i = 0; i < numServers; i++) for (i = 0; i < numServers; i++)
@ -775,6 +807,7 @@ static void connectRpc(RpcCtx *s)
printf("\n"); printf("\n");
//ServerListAlreadyPrinted = TRUE; //ServerListAlreadyPrinted = TRUE;
} }
# endif // NO_VERBOSE_LOG
} }
else // Just use the server supplied on the command line else // Just use the server supplied on the command line
{ {
@ -794,16 +827,21 @@ static void connectRpc(RpcCtx *s)
if (*s == INVALID_RPCCTX) continue; if (*s == INVALID_RPCCTX) continue;
if (verbose) # ifndef NO_VERBOSE_LOG
printf("\nPerforming RPC bind ...\n"); if (verbose) printf("\nPerforming RPC bind ...\n");
if (rpcBindClient(*s, verbose)) if (rpcBindClient(*s, verbose))
# else
if (rpcBindClient(*s, FALSE))
# endif
{ {
errorout("Warning: Could not bind RPC\n"); errorout("Warning: Could not bind RPC\n");
continue; continue;
} }
# ifndef NO_VERBOSE_LOG
if (verbose) printf("... successful\n"); if (verbose) printf("... successful\n");
# endif
return; return;
} }
@ -1298,13 +1336,14 @@ static void CreateRequestBase(REQUEST *Request)
Request->WorkstationName[size] = 0; Request->WorkstationName[size] = 0;
} }
//Show Details # ifndef NO_VERBOSE_LOG
if (verbose) if (verbose)
{ {
printf("\nRequest Parameters\n==================\n\n"); printf("\nRequest Parameters\n==================\n\n");
logRequestVerbose(Request, &printf); logRequestVerbose(Request, &printf);
printf("\n"); printf("\n");
} }
# endif // NO_VERBOSE_LOG
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
.TH VLMCSD 7 "June 2014" "Hotbird64" "KMS Activation Manual" .TH VLMCSD 7 "March 2016" "Hotbird64" "KMS Activation Manual"
.SH NAME .SH NAME
vlmcsd\ \-\ a guide to KMS activation using vlmcsd vlmcsd\ \-\ a guide to KMS activation using vlmcsd
@ -41,6 +41,14 @@ Office 2013: http://technet.microsoft.com/en-us/library/dn385360.aspx
.PP .PP
These lists only include products that Microsoft sells to corporations via volume license contracts. For Windows there are inofficial GVLKs that work with consumer-only versions of Windows. Here is a list: These lists only include products that Microsoft sells to corporations via volume license contracts. For Windows there are inofficial GVLKs that work with consumer-only versions of Windows. Here is a list:
.PP .PP
TX9XD\-98N7V\-6WMQ6\-BX7FG\-H8Q99 - Windows 10 Home
.br
3KHY7\-WNT83\-DGQKR\-F7HPR\-844BM - Windows 10 Home N
.br
7HNRX\-D7KGG\-3K4RQ\-4WPJ4\-YTDFH - Windows 10 Home Single Language
.br
PVMJN\-6DFY6\-9CCP6\-7BKTT\-D3WVR - Windows 10 Home Country Specific
.br
789NJ\-TQK6T\-6XTH8\-J39CJ\-J8D3P - Windows 8.1 Professional with Media Center 789NJ\-TQK6T\-6XTH8\-J39CJ\-J8D3P - Windows 8.1 Professional with Media Center
.br .br
M9Q9P\-WNJJT\-6PXPY\-DWX8H\-6XWKK - Windows 8.1 Core M9Q9P\-WNJJT\-6PXPY\-DWX8H\-6XWKK - Windows 8.1 Core

View File

@ -76,6 +76,10 @@ DESCRIPTION
via volume license contracts. For Windows there are inofficial GVLKs via volume license contracts. For Windows there are inofficial GVLKs
that work with consumer-only versions of Windows. Here is a list: that work with consumer-only versions of Windows. Here is a list:
TX9XD-98N7V-6WMQ6-BX7FG-H8Q99 - Windows 10 Home
3KHY7-WNT83-DGQKR-F7HPR-844BM - Windows 10 Home N
7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH - Windows 10 Home Single Language
PVMJN-6DFY6-9CCP6-7BKTT-D3WVR - Windows 10 Home Country Specific
789NJ-TQK6T-6XTH8-J39CJ-J8D3P - Windows 8.1 Professional with Media 789NJ-TQK6T-6XTH8-J39CJ-J8D3P - Windows 8.1 Professional with Media
Center Center
M9Q9P-WNJJT-6PXPY-DWX8H-6XWKK - Windows 8.1 Core M9Q9P-WNJJT-6PXPY-DWX8H-6XWKK - Windows 8.1 Core
@ -219,4 +223,4 @@ SEE ALSO
Hotbird64 June 2014 VLMCSD(7) Hotbird64 March 2016 VLMCSD(7)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 --> <!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Tue Mar 8 00:06:21 2016 --> <!-- CreationDate: Sun Jun 5 14:31:10 2016 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
@ -169,8 +169,16 @@ inofficial GVLKs that work with consumer-only versions of
Windows. Here is a list:</p> Windows. Here is a list:</p>
<p style="margin-left:11%; margin-top: 1em">789NJ&minus;TQK6T&minus;6XTH8&minus;J39CJ&minus;J8D3P <p style="margin-left:11%; margin-top: 1em">TX9XD&minus;98N7V&minus;6WMQ6&minus;BX7FG&minus;H8Q99
- Windows 8.1 Professional with Media Center <br> - Windows 10 Home <br>
3KHY7&minus;WNT83&minus;DGQKR&minus;F7HPR&minus;844BM -
Windows 10 Home N <br>
7HNRX&minus;D7KGG&minus;3K4RQ&minus;4WPJ4&minus;YTDFH -
Windows 10 Home Single Language <br>
PVMJN&minus;6DFY6&minus;9CCP6&minus;7BKTT&minus;D3WVR -
Windows 10 Home Country Specific <br>
789NJ&minus;TQK6T&minus;6XTH8&minus;J39CJ&minus;J8D3P -
Windows 8.1 Professional with Media Center <br>
M9Q9P&minus;WNJJT&minus;6PXPY&minus;DWX8H&minus;6XWKK - M9Q9P&minus;WNJJT&minus;6PXPY&minus;DWX8H&minus;6XWKK -
Windows 8.1 Core <br> Windows 8.1 Core <br>
7B9N3&minus;D94CG&minus;YTVHR&minus;QBPX3&minus;RJP64 - 7B9N3&minus;D94CG&minus;YTVHR&minus;QBPX3&minus;RJP64 -

Binary file not shown.

View File

@ -76,6 +76,10 @@ DESCRIPTION
via volume license contracts. For Windows there are inofficial GVLKs via volume license contracts. For Windows there are inofficial GVLKs
that work with consumer-only versions of Windows. Here is a list: that work with consumer-only versions of Windows. Here is a list:
TX9XD-98N7V-6WMQ6-BX7FG-H8Q99 - Windows 10 Home
3KHY7-WNT83-DGQKR-F7HPR-844BM - Windows 10 Home N
7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH - Windows 10 Home Single Language
PVMJN-6DFY6-9CCP6-7BKTT-D3WVR - Windows 10 Home Country Specific
789NJ-TQK6T-6XTH8-J39CJ-J8D3P - Windows 8.1 Professional with Media 789NJ-TQK6T-6XTH8-J39CJ-J8D3P - Windows 8.1 Professional with Media
Center Center
M9Q9P-WNJJT-6PXPY-DWX8H-6XWKK - Windows 8.1 Core M9Q9P-WNJJT-6PXPY-DWX8H-6XWKK - Windows 8.1 Core
@ -219,4 +223,4 @@ SEE ALSO
Hotbird64 June 2014 VLMCSD(7) Hotbird64 March 2016 VLMCSD(7)

View File

@ -1,5 +1,5 @@
.mso www.tmac .mso www.tmac
.TH VLMCSD 8 "September 2015" "Hotbird64" "KMS Activation Manual" .TH VLMCSD 8 "June 2016" "Hotbird64" "KMS Activation Manual"
.LO 8 .LO 8
.SH NAME .SH NAME
@ -27,6 +27,9 @@ All options that do no require an argument may be combined with a single dash, f
.IP "\fB-h\fR or \fB-?\fR" .IP "\fB-h\fR or \fB-?\fR"
Displays help. Displays help.
.IP "\fB-V\fR"
Displays extended version information. This includes the compiler used to build vlmcsd, the intended platform and flags (compile time options) to build vlmcsd. If you have the source code of vlmcsd, you can type \fBmake help\fR (or \fBgmake help\fR on systems that do not use the GNU version of \fBmake\fR(1) by default) to see the meaning of those flags.
.IP "\fB-L\fR \fIipaddress\fR[:\fIport\fR]" .IP "\fB-L\fR \fIipaddress\fR[:\fIport\fR]"
Instructs vlmcsd to listen on \fIipaddress\fR with optional \fIport\fR (default 1688). You can use this option more than once. If you do not specify \fB-L\fR at least once, IP addresses 0.0.0.0 (IPv4) and :: (IPv6) are used. If the IP address contains colons (IPv6) you must enclose the IP address in brackets if you specify the optional port, e.g. [2001:db8::dead:beef]:1688. Instructs vlmcsd to listen on \fIipaddress\fR with optional \fIport\fR (default 1688). You can use this option more than once. If you do not specify \fB-L\fR at least once, IP addresses 0.0.0.0 (IPv4) and :: (IPv6) are used. If the IP address contains colons (IPv6) you must enclose the IP address in brackets if you specify the optional port, e.g. [2001:db8::dead:beef]:1688.
.PP .PP
@ -39,11 +42,8 @@ If you specify a link local IPv6 address (fe80::/10, usually starting with fe80:
.IP "\fB-P\fR \fIport" .IP "\fB-P\fR \fIport"
Use TCP \fIport\fR for all subsequent \fB-L\fR statements that do not include an optional port. If you use \fB-P\fR and \fB-L\fR, \fB-P\fR must be specified before \fB-L\fR. Use TCP \fIport\fR for all subsequent \fB-L\fR statements that do not include an optional port. If you use \fB-P\fR and \fB-L\fR, \fB-P\fR must be specified before \fB-L\fR.
.IP "\fB-4\fR and \fB-6\fR" .IP "\fB-F0\fR and \fB-F1\fR
Used to control the use of IPv4 and IPv4 if you did not use -L. If you specify both \fB-4\fR and \fB-6\fR or none, vlmcsd uses both protocols. If you specify only one, that protocol will be used only. \fBThese options are deprecated and will be removed.\fR Allow (\fB-F1\fR) or disallow (\fB-F0\fR) binding to IP addresses that are currently not configured on your system. The default is \fB-F0\fR. \fB-F1\fR allows you to bind to an IP address that may be configured after you started \fBvlmcsd\fR. \fBvlmcsd\fR will listen on that address as soon as it becomes available. This feature is only available under Linux (IPv4 and IPv6) and FreeBSD (IPv4 only). FreeBSD allows this feature only for the root user (more correctly: processes that have the PRIV_NETINET_BINDANY privilege). Linux does not require a capability for this.
.IP "\fB-I\fR"
This option is deprecated and does nothing. It is provided for compatibility with svn681 and earlier versions only. It will be removed in a future release.
.IP "\fB-t\fR \fIseconds\fR" .IP "\fB-t\fR \fIseconds\fR"
Timeout the TCP connection with the client after \fIseconds\fR seconds. After sending an activation request. RPC keeps the TCP connection for a while. The default is 30 seconds. You may specify a shorter period to free ressources on your device faster. This is useful for devices with limited main memory or if you used \fB-m\fR to limit the concurrent clients that may request activation. Microsoft RPC clients disconnect after 30 seconds by default. Setting \fIseconds\fR to a greater value does not make much sense. Timeout the TCP connection with the client after \fIseconds\fR seconds. After sending an activation request. RPC keeps the TCP connection for a while. The default is 30 seconds. You may specify a shorter period to free ressources on your device faster. This is useful for devices with limited main memory or if you used \fB-m\fR to limit the concurrent clients that may request activation. Microsoft RPC clients disconnect after 30 seconds by default. Setting \fIseconds\fR to a greater value does not make much sense.
@ -79,9 +79,6 @@ The native Windows version never daemonizes and always behaves as if \fB-D\fR ha
.IP "\fB-e\fR" .IP "\fB-e\fR"
If specified, vlmcsd ignores \fB-l\fR and writes all logging output to \fBstdout\fR(3). This is mainly useful for testing and debugging and often combined with \fB-D\fR. If specified, vlmcsd ignores \fB-l\fR and writes all logging output to \fBstdout\fR(3). This is mainly useful for testing and debugging and often combined with \fB-D\fR.
.IP "\fB-f\fR"
This flag combines \fB-D\fR and \fB-e\fR. So typing "vlmcsd -f" is identical to "vlmcsd -De". The purpose of \fB-f\fR is to provide compatibility with previous versions of vlmcsd. \fBThis option is deprecated and will be removed.\fR
.IP "\fB-v\fR" .IP "\fB-v\fR"
Use verbose logging. Logs every parameter of the base request and the base response. It also logs the HWID of the KMS server if KMS protocol version 6 is used. This option is mainly for debugging purposes. It only has an effect if some form of logging is used. Thus \fB-v\fR does not make sense if not used with \fB-l\fR, \fB-e\fR or \fB-f\fR. Use verbose logging. Logs every parameter of the base request and the base response. It also logs the HWID of the KMS server if KMS protocol version 6 is used. This option is mainly for debugging purposes. It only has an effect if some form of logging is used. Thus \fB-v\fR does not make sense if not used with \fB-l\fR, \fB-e\fR or \fB-f\fR.

View File

@ -52,46 +52,54 @@ OPTIONS
Displays help. Displays help.
-V Displays extended version information. This includes the com
piler used to build vlmcsd, the intended platform and flags
(compile time options) to build vlmcsd. If you have the source
code of vlmcsd, you can type make help (or gmake help on systems
that do not use the GNU version of make(1) by default) to see
the meaning of those flags.
-L ipaddress[:port] -L ipaddress[:port]
Instructs vlmcsd to listen on ipaddress with optional port Instructs vlmcsd to listen on ipaddress with optional port
(default 1688). You can use this option more than once. If you (default 1688). You can use this option more than once. If you
do not specify -L at least once, IP addresses 0.0.0.0 (IPv4) and do not specify -L at least once, IP addresses 0.0.0.0 (IPv4) and
:: (IPv6) are used. If the IP address contains colons (IPv6) you :: (IPv6) are used. If the IP address contains colons (IPv6) you
must enclose the IP address in brackets if you specify the must enclose the IP address in brackets if you specify the
optional port, e.g. [2001:db8::dead:beef]:1688. optional port, e.g. [2001:db8::dead:beef]:1688.
If no port is specified, vlmcsd uses the default port according If no port is specified, vlmcsd uses the default port according
to a preceding -P option. If you specify a port, it can be a to a preceding -P option. If you specify a port, it can be a
number (1-65535) or a name (usually found in /etc/services if number (1-65535) or a name (usually found in /etc/services if
not provided via LDAP, NIS+ or another name service). not provided via LDAP, NIS+ or another name service).
If you specify a link local IPv6 address (fe80::/10, usually If you specify a link local IPv6 address (fe80::/10, usually
starting with fe80::), it must be followed by a percent sign (%) starting with fe80::), it must be followed by a percent sign (%)
and a scope id (=network interface name or number) on most and a scope id (=network interface name or number) on most
unixoid OSses including Linux, Android, MacOS X and iOS, e.g. unixoid OSses including Linux, Android, MacOS X and iOS, e.g.
fe80::1234:56ff:fe78:9abc%eth0 or fe80::1234:56ff:fe78:9abc%eth0 or
[fe80::1234:56ff:fe78:9abc%2]:1688. Windows (including cygwin) [fe80::1234:56ff:fe78:9abc%2]:1688. Windows (including cygwin)
does not require a scope id unless the same link local address does not require a scope id unless the same link local address
is used on more than one network interface. Windows does not is used on more than one network interface. Windows does not
accept a name and the scope id must be a number. accept a name and the scope id must be a number.
-P port -P port
Use TCP port for all subsequent -L statements that do not Use TCP port for all subsequent -L statements that do not
include an optional port. If you use -P and -L, -P must be spec include an optional port. If you use -P and -L, -P must be spec
ified before -L. ified before -L.
-4 and -6 -F0 and -F1
Used to control the use of IPv4 and IPv4 if you did not use -L. Allow (-F1) or disallow (-F0) binding to IP addresses that are
If you specify both -4 and -6 or none, vlmcsd uses both proto currently not configured on your system. The default is -F0. -F1
cols. If you specify only one, that protocol will be used only. allows you to bind to an IP address that may be configured after
These options are deprecated and will be removed. you started vlmcsd. vlmcsd will listen on that address as soon
as it becomes available. This feature is only available under
Linux (IPv4 and IPv6) and FreeBSD (IPv4 only). FreeBSD allows
-I This option is deprecated and does nothing. It is provided for this feature only for the root user (more correctly: processes
compatibility with svn681 and earlier versions only. It will be that have the PRIV_NETINET_BINDANY privilege). Linux does not
removed in a future release. require a capability for this.
-t seconds -t seconds
@ -181,60 +189,54 @@ OPTIONS
often combined with -D. often combined with -D.
-f This flag combines -D and -e. So typing "vlmcsd -f" is identical -v Use verbose logging. Logs every parameter of the base request
to "vlmcsd -De". The purpose of -f is to provide compatibility and the base response. It also logs the HWID of the KMS server
with previous versions of vlmcsd. This option is deprecated and if KMS protocol version 6 is used. This option is mainly for
will be removed. debugging purposes. It only has an effect if some form of log
ging is used. Thus -v does not make sense if not used with -l,
-v Use verbose logging. Logs every parameter of the base request
and the base response. It also logs the HWID of the KMS server
if KMS protocol version 6 is used. This option is mainly for
debugging purposes. It only has an effect if some form of log
ging is used. Thus -v does not make sense if not used with -l,
-e or -f. -e or -f.
-q Do not use verbose logging. This is actually the default behav -q Do not use verbose logging. This is actually the default behav
ior. It only makes sense if you use vlmcsd with an ini file (see ior. It only makes sense if you use vlmcsd with an ini file (see
-i and vlmcsd.ini(5)). If the ini file contains the line -i and vlmcsd.ini(5)). If the ini file contains the line
"LogVerbose = true" you can use -q to restore the default behav "LogVerbose = true" you can use -q to restore the default behav
ior. ior.
-p filename -p filename
Create pid file filename. This has nothing to do with KMS ePIDs. Create pid file filename. This has nothing to do with KMS ePIDs.
A pid file is a file where vlmcsd writes its own process id. A pid file is a file where vlmcsd writes its own process id.
This is used by standard init scripts (typically found in This is used by standard init scripts (typically found in
/etc/init.d). The default is not to write a pid file. /etc/init.d). The default is not to write a pid file.
-u user and -g group -u user and -g group
Causes vlmcsd to run in the specified user and group security Causes vlmcsd to run in the specified user and group security
context. The main purpose for this is to drop root privileges context. The main purpose for this is to drop root privileges
after it has been started from the root account. To use this after it has been started from the root account. To use this
feature from cygwin you must run cyglsa-config and the account feature from cygwin you must run cyglsa-config and the account
from which vlmcsd is started must have the rights "Act as part from which vlmcsd is started must have the rights "Act as part
of the operating system" and "Replace a process level token". of the operating system" and "Replace a process level token".
The native Windows version does not support these options. The native Windows version does not support these options.
The actual security context switch is performed after the TCP The actual security context switch is performed after the TCP
sockets have been created. This allows you to use privileged sockets have been created. This allows you to use privileged
ports (< 1024) when you start vlmcsd from the root account. ports (< 1024) when you start vlmcsd from the root account.
However if you use an ini, pid or log file, you must ensure that However if you use an ini, pid or log file, you must ensure that
the unprivileged user has access to these files. You can always the unprivileged user has access to these files. You can always
log to syslog(3) from an unprivileged account on most platforms log to syslog(3) from an unprivileged account on most platforms
(see -l). (see -l).
-w ePID -w ePID
Use ePID as Windows ePID. If specified, -r is disregarded for Use ePID as Windows ePID. If specified, -r is disregarded for
Windows. Windows.
-0 ePID -0 ePID
Use ePID as Office 2010 ePID (including Project and Visio). If Use ePID as Office 2010 ePID (including Project and Visio). If
specified, -r is disregarded for Office 2010. specified, -r is disregarded for Office 2010.
@ -244,14 +246,14 @@ OPTIONS
-H HwId -H HwId
Use HwId for all products. All HWIDs in the ini file (see -i) Use HwId for all products. All HWIDs in the ini file (see -i)
will not be used. In an ini file you can specify a seperate HWID will not be used. In an ini file you can specify a seperate HWID
for each application-guid. This is not possible when entering a for each application-guid. This is not possible when entering a
HWID from the command line. HWID from the command line.
HwId must be specified as 16 hex digits that are interpreted as HwId must be specified as 16 hex digits that are interpreted as
a series of 8 bytes (big endian). Any character that is not a a series of 8 bytes (big endian). Any character that is not a
hex digit will be ignored. This is for better readability. The hex digit will be ignored. This is for better readability. The
following commands are identical: following commands are identical:
vlmcsd -H 0123456789ABCDEF vlmcsd -H 0123456789ABCDEF
@ -260,14 +262,14 @@ OPTIONS
-i filename -i filename
Use configuration file (aka ini file) filename. Most configura Use configuration file (aka ini file) filename. Most configura
tion parameters can be set either via the command line or an ini tion parameters can be set either via the command line or an ini
file. The command line always has precedence over configuration file. The command line always has precedence over configuration
items in the ini file. See vlmcsd.ini(5) for the format of the items in the ini file. See vlmcsd.ini(5) for the format of the
configuration file. configuration file.
If vlmcsd has been compiled to use a default configuration file If vlmcsd has been compiled to use a default configuration file
(often /etc/vlmcsd.ini), you may use -i- to ignore the default (often /etc/vlmcsd.ini), you may use -i- to ignore the default
configuration file. configuration file.
@ -280,118 +282,118 @@ OPTIONS
- the file specified by -i does not contain the application-guid - the file specified by -i does not contain the application-guid
for the KMS request for the KMS request
-r0 means there are no random ePIDs. vlmcsd simply issues -r0 means there are no random ePIDs. vlmcsd simply issues
default ePIDs that are built into the binary at compile time. default ePIDs that are built into the binary at compile time.
Pro: behaves like real KMS server that also always issues the Pro: behaves like real KMS server that also always issues the
same ePID. Con: Microsoft may start blacklisting again and the same ePID. Con: Microsoft may start blacklisting again and the
default ePID may not work any longer. default ePID may not work any longer.
-r1 instructs vlmcsd to generate random ePIDs when the program -r1 instructs vlmcsd to generate random ePIDs when the program
starts or receives a SIGHUP signal and uses these ePIDs until it starts or receives a SIGHUP signal and uses these ePIDs until it
is stopped or receives another SIGHUP. Most other KMS emulators is stopped or receives another SIGHUP. Most other KMS emulators
generate a new ePID on every KMS request. This is easily generate a new ePID on every KMS request. This is easily
detectable. Microsoft could just modify sppsvc.exe in a way that detectable. Microsoft could just modify sppsvc.exe in a way that
it always sends two identical KMS requests in two RPC requests it always sends two identical KMS requests in two RPC requests
but over the same TCP connection. If both KMS responses contain but over the same TCP connection. If both KMS responses contain
the different ePIDs, the KMS server is not genuine. -r1 is the the different ePIDs, the KMS server is not genuine. -r1 is the
default mode. -r1 also ensures that all three ePIDs (Windows, default mode. -r1 also ensures that all three ePIDs (Windows,
Office 2010 and Office 2013) use the same OS build number and Office 2010 and Office 2013) use the same OS build number and
LCID (language id). LCID (language id).
If vlmcsd has been started by an internet superserver, -r1 works If vlmcsd has been started by an internet superserver, -r1 works
identically to -r2. This is simply due to the fact that vlmcsd identically to -r2. This is simply due to the fact that vlmcsd
is started upon a connection request and does not stay in memory is started upon a connection request and does not stay in memory
after servicing a KMS request. after servicing a KMS request.
-r2 behaves like most other KMS server emulators with random -r2 behaves like most other KMS server emulators with random
support and generates a new random ePID on every request. Use support and generates a new random ePID on every request. Use
this mode with "care". However since Microsoft currently does this mode with "care". However since Microsoft currently does
not seem to do any verification of the ePID, you currently don't not seem to do any verification of the ePID, you currently don't
need to pay attention to ePIDs at all. need to pay attention to ePIDs at all.
-C LCID -C LCID
Do not randomize the locale id part of the ePID and use LCID Do not randomize the locale id part of the ePID and use LCID
instead. The LCID must be specified as a decimal number, e.g. instead. The LCID must be specified as a decimal number, e.g.
1049 for "Russian - Russia". This option has no effect if the 1049 for "Russian - Russia". This option has no effect if the
ePID is not randomized at all, e.g. if it is selected from the ePID is not randomized at all, e.g. if it is selected from the
command line or an ini file. command line or an ini file.
By default vlmcsd generates a valid locale id that is recognized By default vlmcsd generates a valid locale id that is recognized
by .NET Framework 4.0. This may lead to a locale id which is by .NET Framework 4.0. This may lead to a locale id which is
unlikely to occur in your country, for instance 2155 for "Quecha unlikely to occur in your country, for instance 2155 for "Quecha
- Ecuador". You may want to select the locale id of your country - Ecuador". You may want to select the locale id of your country
instead. See MSDN ⟨http://msdn.microsoft.com/en-us/goglobal/ instead. See MSDN ⟨http://msdn.microsoft.com/en-us/goglobal/
bb964664.aspx⟩ for a list of valid LCIDs. Please note that some bb964664.aspx⟩ for a list of valid LCIDs. Please note that some
of them are not recognized by .NET Framework 4.0. of them are not recognized by .NET Framework 4.0.
Most other KMS emulators use a fixed LCID of 1033 (English - Most other KMS emulators use a fixed LCID of 1033 (English -
US). To achive the same behavior in vlmcsd use -C 1033. US). To achive the same behavior in vlmcsd use -C 1033.
-R renewal-interval -R renewal-interval
Instructs clients to renew activation every renewal-interval. Instructs clients to renew activation every renewal-interval.
The renewal-interval is a number optionally immediately followed The renewal-interval is a number optionally immediately followed
by a letter indicating the unit. Valid unit letters are s (sec by a letter indicating the unit. Valid unit letters are s (sec
onds), m (minutes), h (hours), d (days) and w (weeks). If you do onds), m (minutes), h (hours), d (days) and w (weeks). If you do
not specify a letter, minutes is assumed. not specify a letter, minutes is assumed.
-R3d for instance instructs clients to renew activation every 3 -R3d for instance instructs clients to renew activation every 3
days. The default renewal-interval is 10080 (identical to 7d and days. The default renewal-interval is 10080 (identical to 7d and
1w). 1w).
Due to poor implementation of Microsofts KMS Client it cannot be Due to poor implementation of Microsofts KMS Client it cannot be
guaranteed that activation is renewed on time as specfied by the guaranteed that activation is renewed on time as specfied by the
-R option. Don't care about that. Renewal will happen well -R option. Don't care about that. Renewal will happen well
before your activation expires (usually 180 days). before your activation expires (usually 180 days).
Even though you can specify seconds, the granularity of this Even though you can specify seconds, the granularity of this
option is 1 minute. Seconds are rounded down to the next multi option is 1 minute. Seconds are rounded down to the next multi
ple of 60. ple of 60.
-A activation-interval -A activation-interval
Instructs clients to retry activation every activation-interval Instructs clients to retry activation every activation-interval
if it was unsuccessful, e.g. because it could not reach the if it was unsuccessful, e.g. because it could not reach the
server. The default is 120 (identical to 2h). activation-inter server. The default is 120 (identical to 2h). activation-inter
val follows the same syntax as renewal-interval in the -R val follows the same syntax as renewal-interval in the -R
option. option.
-s Installs vlmcsd as a Windows service. This option only works -s Installs vlmcsd as a Windows service. This option only works
with the native Windows version and Cygwin. Combine -s with with the native Windows version and Cygwin. Combine -s with
other command line options. These will be in effect when you other command line options. These will be in effect when you
start the service. The service automatically starts when you start the service. The service automatically starts when you
reboot your machine. To start it manually, type "net start vlm reboot your machine. To start it manually, type "net start vlm
csd". csd".
If you use Cygwin, you must include your Cygwin system DLL If you use Cygwin, you must include your Cygwin system DLL
directory (usually C:\Cygwin\bin or C:\Cygwin64\bin) into the directory (usually C:\Cygwin\bin or C:\Cygwin64\bin) into the
PATH environment variable or the service will not start. PATH environment variable or the service will not start.
You can reinstall the service anytime using vlmcsd -s again, You can reinstall the service anytime using vlmcsd -s again,
e.g. with a different command line. If the service is running, e.g. with a different command line. If the service is running,
it will be restarted with the new command line. it will be restarted with the new command line.
When using -s the command line is checked for basic syntax When using -s the command line is checked for basic syntax
errors only. For example "vlmcsd -s -L 1.2.3.4" reports no error errors only. For example "vlmcsd -s -L 1.2.3.4" reports no error
but the service will not start if 1.2.3.4 is not an IP address but the service will not start if 1.2.3.4 is not an IP address
on your system. on your system.
-S Uninstalls the vlmcsd service. Works only with the native Win -S Uninstalls the vlmcsd service. Works only with the native Win
dows version and Cygwin. All other options will be ignored if dows version and Cygwin. All other options will be ignored if
you include -S in the command line. you include -S in the command line.
-U [domain\]username -U [domain\]username
Can only be used together with -s. Starts the service as a dif Can only be used together with -s. Starts the service as a dif
ferent user than the local SYSTEM account. This is used to run ferent user than the local SYSTEM account. This is used to run
the service under an account with low privileges. If you omit the service under an account with low privileges. If you omit
the domain, an account from the local computer will be used. the domain, an account from the local computer will be used.
You may use "NT AUTHORITY\NetworkService". This is a pseudo user You may use "NT AUTHORITY\NetworkService". This is a pseudo user
with low privileges. You may also use "NT AUTHORITY\LocalSer with low privileges. You may also use "NT AUTHORITY\LocalSer
vice" which has more privileges but these are of no use for run vice" which has more privileges but these are of no use for run
ning vlmcsd. ning vlmcsd.
@ -399,20 +401,20 @@ OPTIONS
sion for your executable. "NT AUTHORITY\NetworkService" normally sion for your executable. "NT AUTHORITY\NetworkService" normally
has no permission to run binaries from your home directory. has no permission to run binaries from your home directory.
For your convenience you can use the special username "/l" as a For your convenience you can use the special username "/l" as a
shortcut for "NT AUTHORITY\LocalService" and "/n" for "NT shortcut for "NT AUTHORITY\LocalService" and "/n" for "NT
AUTHORITY\NetworkService". "vlmcsd -s -U /n" installs the ser AUTHORITY\NetworkService". "vlmcsd -s -U /n" installs the ser
vice to run as "NT AUTHORITY\NetworkService". vice to run as "NT AUTHORITY\NetworkService".
-W password -W password
Can only be used together with -s. Specifies a password for the Can only be used together with -s. Specifies a password for the
corresponding username you use with -U. SYSTEM, "NT AUTHOR corresponding username you use with -U. SYSTEM, "NT AUTHOR
ITY\NetworkService", "NT AUTHORITY\LocalService" do not require ITY\NetworkService", "NT AUTHORITY\LocalService" do not require
a password. a password.
If you specify a user with even lower privileges than "NT If you specify a user with even lower privileges than "NT
AUTHORITY\NetworkService", you must specify its password. You AUTHORITY\NetworkService", you must specify its password. You
also have to grant the "Log on as a service" right to that user. also have to grant the "Log on as a service" right to that user.
@ -421,50 +423,50 @@ SIGNALS
SIGTERM, SIGINT SIGTERM, SIGINT
These signals cause vlmcsd to exit gracefully. All global sema These signals cause vlmcsd to exit gracefully. All global sema
phores and shared memory pages will be released, the pid file phores and shared memory pages will be released, the pid file
will be unlinked (deleted) and a shutdown message will be will be unlinked (deleted) and a shutdown message will be
logged. logged.
SIGHUP Causes vlmcsd to be restarted completely. This is useful if you SIGHUP Causes vlmcsd to be restarted completely. This is useful if you
started vlmcsd with an ini file. You can modify the ini file started vlmcsd with an ini file. You can modify the ini file
while vlmcsd is running and then sending SIGHUP, e.g. by typing while vlmcsd is running and then sending SIGHUP, e.g. by typing
"killall -SIGHUP vlmcsd" or "kill -SIGHUP `cat /var/run/vlm "killall -SIGHUP vlmcsd" or "kill -SIGHUP `cat /var/run/vlm
csd.pid`". csd.pid`".
The SIGHUP handler has been implemented relatively simple. It is The SIGHUP handler has been implemented relatively simple. It is
virtually the same as stopping vlmcsd and starting it again virtually the same as stopping vlmcsd and starting it again
immediately with the following exceptions: immediately with the following exceptions:
— The new process does not get a new process id. — The new process does not get a new process id.
— If you used a pid file, it is not deleted and recreated — If you used a pid file, it is not deleted and recreated
because the process id stays the same. because the process id stays the same.
— If you used the 'user' and/or 'group' directive in an ini — If you used the 'user' and/or 'group' directive in an ini
file these are ignored. This is because once you switched to file these are ignored. This is because once you switched to
lower privileged users and groups, there is no way back. Any lower privileged users and groups, there is no way back. Any
thing else would be a severe security flaw in the OS. thing else would be a severe security flaw in the OS.
Signaling is not available in the native Windows version and in the Signaling is not available in the native Windows version and in the
Cygwin version when it runs as Windows service. Cygwin version when it runs as Windows service.
SUPPORTED OPERATING SYSTEMS SUPPORTED OPERATING SYSTEMS
vlmcsd compiles and runs on Linux, Windows (no Cygwin required but vlmcsd compiles and runs on Linux, Windows (no Cygwin required but
explicitly supported), Mac OS X, FreeBSD, NetBSD, OpenBSD, Dragonfly explicitly supported), Mac OS X, FreeBSD, NetBSD, OpenBSD, Dragonfly
BSD, Minix, Solaris, OpenIndiana, Android and iOS. Other POSIX or BSD, Minix, Solaris, OpenIndiana, Android and iOS. Other POSIX or
unixoid OSses may work with unmodified sources or may require minor unixoid OSses may work with unmodified sources or may require minor
porting efforts. porting efforts.
SUPPORTED PRODUCTS SUPPORTED PRODUCTS
vlmcsd can answer activation requests for the following products: Win vlmcsd can answer activation requests for the following products: Win
dows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows dows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows
Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows
Server 2012 R2, Office 2010, Project 2010, Visio 2010, Office 2013, Server 2012 R2, Office 2010, Project 2010, Visio 2010, Office 2013,
Project 2013, Visio 2013, Office 2016, Project 2016, Visio 2016. Project 2013, Visio 2013, Office 2016, Project 2016, Visio 2016.
Office, Project and Visio must be volume license versions. Office, Project and Visio must be volume license versions.
@ -476,24 +478,24 @@ FILES
EXAMPLES EXAMPLES
vlmcsd -f vlmcsd -f
Starts vlmcsd in foreground. Useful if you use it for the first Starts vlmcsd in foreground. Useful if you use it for the first
time and want to see what's happening when a client requests time and want to see what's happening when a client requests
activation. activation.
vlmcsd -l /var/log/vlmcsd.log vlmcsd -l /var/log/vlmcsd.log
Starts vlmcsd as a daemon and logs everything to /var/log/vlm Starts vlmcsd as a daemon and logs everything to /var/log/vlm
csd.log. csd.log.
vlmcsd -L 192.168.1.17 vlmcsd -L 192.168.1.17
Starts vlmcsd as a daemon and listens on IP address 192.168.1.17 Starts vlmcsd as a daemon and listens on IP address 192.168.1.17
only. This is useful for routers that have a public and a pri only. This is useful for routers that have a public and a pri
vate IP address to prevent your KMS server from becoming public. vate IP address to prevent your KMS server from becoming public.
vlmcsd -s -U /n -l C:\logs\vlmcsd.log vlmcsd -s -U /n -l C:\logs\vlmcsd.log
Installs vlmcsd as a Windows service with low privileges and Installs vlmcsd as a Windows service with low privileges and
logs everything to C:\logs\vlmcsd.log when the service is logs everything to C:\logs\vlmcsd.log when the service is
started with "net start vlmcsd". started with "net start vlmcsd".
@ -501,18 +503,18 @@ EXAMPLES
BUGS BUGS
An ePID specified in an ini file must not contain spaces. An ePID specified in an ini file must not contain spaces.
The maximum number of -L options in the command line or listen state The maximum number of -L options in the command line or listen state
ments in the inifile is the platform default for FD_SETSIZE. This is 64 ments in the inifile is the platform default for FD_SETSIZE. This is 64
on Windows and 1024 on most Unixes. on Windows and 1024 on most Unixes.
AUTHOR AUTHOR
Written by crony12, Hotbird64 and vityan666. With contributions from Written by crony12, Hotbird64 and vityan666. With contributions from
DougQaid. DougQaid.
CREDITS CREDITS
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati
borus, ... borus, ...
@ -521,4 +523,4 @@ SEE ALSO
Hotbird64 September 2015 VLMCSD(8) Hotbird64 June 2016 VLMCSD(8)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 --> <!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Tue Mar 8 00:06:22 2016 --> <!-- CreationDate: Sun Jun 5 14:31:10 2016 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
@ -112,6 +112,27 @@ is optional. Thus &quot;vlmcsd -r 2&quot; and &quot;vlmcsd
<p style="margin-left:22%;">Displays help.</p> <p style="margin-left:22%;">Displays help.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p><b>-V</b></p></td>
<td width="8%"></td>
<td width="78%">
<p>Displays extended version information. This includes the
compiler used to build vlmcsd, the intended platform and
flags (compile time options) to build vlmcsd. If you have
the source code of vlmcsd, you can type <b>make help</b> (or
<b>gmake help</b> on systems that do not use the GNU version
of <b>make</b>(1) by default) to see the meaning of those
flags.</p> </td></tr>
</table>
<p style="margin-left:11%;"><b>-L</b> <p style="margin-left:11%;"><b>-L</b>
<i>ipaddress</i>[:<i>port</i>]</p> <i>ipaddress</i>[:<i>port</i>]</p>
@ -149,30 +170,19 @@ subsequent <b>-L</b> statements that do not include an
optional port. If you use <b>-P</b> and <b>-L</b>, <b>-P</b> optional port. If you use <b>-P</b> and <b>-L</b>, <b>-P</b>
must be specified before <b>-L</b>.</p> must be specified before <b>-L</b>.</p>
<p style="margin-left:11%;"><b>-4</b> and <b>-6</b></p> <p style="margin-left:11%;"><b>-F0</b> and <b>-F1</b></p>
<p style="margin-left:22%;">Used to control the use of IPv4 <p style="margin-left:22%;">Allow (<b>-F1</b>) or disallow
and IPv4 if you did not use -L. If you specify both (<b>-F0</b>) binding to IP addresses that are currently not
<b>-4</b> and <b>-6</b> or none, vlmcsd uses both protocols. configured on your system. The default is <b>-F0</b>.
If you specify only one, that protocol will be used only. <b>-F1</b> allows you to bind to an IP address that may be
<b>These options are deprecated and will be removed.</b></p> configured after you started <b>vlmcsd</b>. <b>vlmcsd</b>
will listen on that address as soon as it becomes available.
<table width="100%" border="0" rules="none" frame="void" This feature is only available under Linux (IPv4 and IPv6)
cellspacing="0" cellpadding="0"> and FreeBSD (IPv4 only). FreeBSD allows this feature only
<tr valign="top" align="left"> for the root user (more correctly: processes that have the
<td width="11%"></td> PRIV_NETINET_BINDANY privilege). Linux does not require a
<td width="3%"> capability for this.</p>
<p><b>-I</b></p></td>
<td width="8%"></td>
<td width="78%">
<p>This option is deprecated and does nothing. It is
provided for compatibility with svn681 and earlier versions
only. It will be removed in a future release.</p></td></tr>
</table>
<p style="margin-left:11%;"><b>-t</b> <i>seconds</i></p> <p style="margin-left:11%;"><b>-t</b> <i>seconds</i></p>
@ -321,21 +331,6 @@ combined with <b>-D</b>.</p></td></tr>
<td width="3%"> <td width="3%">
<p><b>-f</b></p></td>
<td width="8%"></td>
<td width="78%">
<p>This flag combines <b>-D</b> and <b>-e</b>. So typing
&quot;vlmcsd -f&quot; is identical to &quot;vlmcsd
-De&quot;. The purpose of <b>-f</b> is to provide
compatibility with previous versions of vlmcsd. <b>This
option is deprecated and will be removed.</b></p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p><b>-v</b></p></td> <p><b>-v</b></p></td>
<td width="8%"></td> <td width="8%"></td>
<td width="78%"> <td width="78%">

Binary file not shown.

View File

@ -52,46 +52,54 @@ OPTIONS
Displays help. Displays help.
-V Displays extended version information. This includes the com
piler used to build vlmcsd, the intended platform and flags
(compile time options) to build vlmcsd. If you have the source
code of vlmcsd, you can type make help (or gmake help on systems
that do not use the GNU version of make(1) by default) to see
the meaning of those flags.
-L ipaddress[:port] -L ipaddress[:port]
Instructs vlmcsd to listen on ipaddress with optional port Instructs vlmcsd to listen on ipaddress with optional port
(default 1688). You can use this option more than once. If you (default 1688). You can use this option more than once. If you
do not specify -L at least once, IP addresses 0.0.0.0 (IPv4) and do not specify -L at least once, IP addresses 0.0.0.0 (IPv4) and
:: (IPv6) are used. If the IP address contains colons (IPv6) you :: (IPv6) are used. If the IP address contains colons (IPv6) you
must enclose the IP address in brackets if you specify the must enclose the IP address in brackets if you specify the
optional port, e.g. [2001:db8::dead:beef]:1688. optional port, e.g. [2001:db8::dead:beef]:1688.
If no port is specified, vlmcsd uses the default port according If no port is specified, vlmcsd uses the default port according
to a preceding -P option. If you specify a port, it can be a to a preceding -P option. If you specify a port, it can be a
number (1-65535) or a name (usually found in /etc/services if number (1-65535) or a name (usually found in /etc/services if
not provided via LDAP, NIS+ or another name service). not provided via LDAP, NIS+ or another name service).
If you specify a link local IPv6 address (fe80::/10, usually If you specify a link local IPv6 address (fe80::/10, usually
starting with fe80::), it must be followed by a percent sign (%) starting with fe80::), it must be followed by a percent sign (%)
and a scope id (=network interface name or number) on most and a scope id (=network interface name or number) on most
unixoid OSses including Linux, Android, MacOS X and iOS, e.g. unixoid OSses including Linux, Android, MacOS X and iOS, e.g.
fe80::1234:56ff:fe78:9abc%eth0 or fe80::1234:56ff:fe78:9abc%eth0 or
[fe80::1234:56ff:fe78:9abc%2]:1688. Windows (including cygwin) [fe80::1234:56ff:fe78:9abc%2]:1688. Windows (including cygwin)
does not require a scope id unless the same link local address does not require a scope id unless the same link local address
is used on more than one network interface. Windows does not is used on more than one network interface. Windows does not
accept a name and the scope id must be a number. accept a name and the scope id must be a number.
-P port -P port
Use TCP port for all subsequent -L statements that do not Use TCP port for all subsequent -L statements that do not
include an optional port. If you use -P and -L, -P must be spec include an optional port. If you use -P and -L, -P must be spec
ified before -L. ified before -L.
-4 and -6 -F0 and -F1
Used to control the use of IPv4 and IPv4 if you did not use -L. Allow (-F1) or disallow (-F0) binding to IP addresses that are
If you specify both -4 and -6 or none, vlmcsd uses both proto currently not configured on your system. The default is -F0. -F1
cols. If you specify only one, that protocol will be used only. allows you to bind to an IP address that may be configured after
These options are deprecated and will be removed. you started vlmcsd. vlmcsd will listen on that address as soon
as it becomes available. This feature is only available under
Linux (IPv4 and IPv6) and FreeBSD (IPv4 only). FreeBSD allows
-I This option is deprecated and does nothing. It is provided for this feature only for the root user (more correctly: processes
compatibility with svn681 and earlier versions only. It will be that have the PRIV_NETINET_BINDANY privilege). Linux does not
removed in a future release. require a capability for this.
-t seconds -t seconds
@ -181,60 +189,54 @@ OPTIONS
often combined with -D. often combined with -D.
-f This flag combines -D and -e. So typing "vlmcsd -f" is identical -v Use verbose logging. Logs every parameter of the base request
to "vlmcsd -De". The purpose of -f is to provide compatibility and the base response. It also logs the HWID of the KMS server
with previous versions of vlmcsd. This option is deprecated and if KMS protocol version 6 is used. This option is mainly for
will be removed. debugging purposes. It only has an effect if some form of log
ging is used. Thus -v does not make sense if not used with -l,
-v Use verbose logging. Logs every parameter of the base request
and the base response. It also logs the HWID of the KMS server
if KMS protocol version 6 is used. This option is mainly for
debugging purposes. It only has an effect if some form of log
ging is used. Thus -v does not make sense if not used with -l,
-e or -f. -e or -f.
-q Do not use verbose logging. This is actually the default behav -q Do not use verbose logging. This is actually the default behav
ior. It only makes sense if you use vlmcsd with an ini file (see ior. It only makes sense if you use vlmcsd with an ini file (see
-i and vlmcsd.ini(5)). If the ini file contains the line -i and vlmcsd.ini(5)). If the ini file contains the line
"LogVerbose = true" you can use -q to restore the default behav "LogVerbose = true" you can use -q to restore the default behav
ior. ior.
-p filename -p filename
Create pid file filename. This has nothing to do with KMS ePIDs. Create pid file filename. This has nothing to do with KMS ePIDs.
A pid file is a file where vlmcsd writes its own process id. A pid file is a file where vlmcsd writes its own process id.
This is used by standard init scripts (typically found in This is used by standard init scripts (typically found in
/etc/init.d). The default is not to write a pid file. /etc/init.d). The default is not to write a pid file.
-u user and -g group -u user and -g group
Causes vlmcsd to run in the specified user and group security Causes vlmcsd to run in the specified user and group security
context. The main purpose for this is to drop root privileges context. The main purpose for this is to drop root privileges
after it has been started from the root account. To use this after it has been started from the root account. To use this
feature from cygwin you must run cyglsa-config and the account feature from cygwin you must run cyglsa-config and the account
from which vlmcsd is started must have the rights "Act as part from which vlmcsd is started must have the rights "Act as part
of the operating system" and "Replace a process level token". of the operating system" and "Replace a process level token".
The native Windows version does not support these options. The native Windows version does not support these options.
The actual security context switch is performed after the TCP The actual security context switch is performed after the TCP
sockets have been created. This allows you to use privileged sockets have been created. This allows you to use privileged
ports (< 1024) when you start vlmcsd from the root account. ports (< 1024) when you start vlmcsd from the root account.
However if you use an ini, pid or log file, you must ensure that However if you use an ini, pid or log file, you must ensure that
the unprivileged user has access to these files. You can always the unprivileged user has access to these files. You can always
log to syslog(3) from an unprivileged account on most platforms log to syslog(3) from an unprivileged account on most platforms
(see -l). (see -l).
-w ePID -w ePID
Use ePID as Windows ePID. If specified, -r is disregarded for Use ePID as Windows ePID. If specified, -r is disregarded for
Windows. Windows.
-0 ePID -0 ePID
Use ePID as Office 2010 ePID (including Project and Visio). If Use ePID as Office 2010 ePID (including Project and Visio). If
specified, -r is disregarded for Office 2010. specified, -r is disregarded for Office 2010.
@ -244,14 +246,14 @@ OPTIONS
-H HwId -H HwId
Use HwId for all products. All HWIDs in the ini file (see -i) Use HwId for all products. All HWIDs in the ini file (see -i)
will not be used. In an ini file you can specify a seperate HWID will not be used. In an ini file you can specify a seperate HWID
for each application-guid. This is not possible when entering a for each application-guid. This is not possible when entering a
HWID from the command line. HWID from the command line.
HwId must be specified as 16 hex digits that are interpreted as HwId must be specified as 16 hex digits that are interpreted as
a series of 8 bytes (big endian). Any character that is not a a series of 8 bytes (big endian). Any character that is not a
hex digit will be ignored. This is for better readability. The hex digit will be ignored. This is for better readability. The
following commands are identical: following commands are identical:
vlmcsd -H 0123456789ABCDEF vlmcsd -H 0123456789ABCDEF
@ -260,14 +262,14 @@ OPTIONS
-i filename -i filename
Use configuration file (aka ini file) filename. Most configura Use configuration file (aka ini file) filename. Most configura
tion parameters can be set either via the command line or an ini tion parameters can be set either via the command line or an ini
file. The command line always has precedence over configuration file. The command line always has precedence over configuration
items in the ini file. See vlmcsd.ini(5) for the format of the items in the ini file. See vlmcsd.ini(5) for the format of the
configuration file. configuration file.
If vlmcsd has been compiled to use a default configuration file If vlmcsd has been compiled to use a default configuration file
(often /etc/vlmcsd.ini), you may use -i- to ignore the default (often /etc/vlmcsd.ini), you may use -i- to ignore the default
configuration file. configuration file.
@ -280,118 +282,118 @@ OPTIONS
- the file specified by -i does not contain the application-guid - the file specified by -i does not contain the application-guid
for the KMS request for the KMS request
-r0 means there are no random ePIDs. vlmcsd simply issues -r0 means there are no random ePIDs. vlmcsd simply issues
default ePIDs that are built into the binary at compile time. default ePIDs that are built into the binary at compile time.
Pro: behaves like real KMS server that also always issues the Pro: behaves like real KMS server that also always issues the
same ePID. Con: Microsoft may start blacklisting again and the same ePID. Con: Microsoft may start blacklisting again and the
default ePID may not work any longer. default ePID may not work any longer.
-r1 instructs vlmcsd to generate random ePIDs when the program -r1 instructs vlmcsd to generate random ePIDs when the program
starts or receives a SIGHUP signal and uses these ePIDs until it starts or receives a SIGHUP signal and uses these ePIDs until it
is stopped or receives another SIGHUP. Most other KMS emulators is stopped or receives another SIGHUP. Most other KMS emulators
generate a new ePID on every KMS request. This is easily generate a new ePID on every KMS request. This is easily
detectable. Microsoft could just modify sppsvc.exe in a way that detectable. Microsoft could just modify sppsvc.exe in a way that
it always sends two identical KMS requests in two RPC requests it always sends two identical KMS requests in two RPC requests
but over the same TCP connection. If both KMS responses contain but over the same TCP connection. If both KMS responses contain
the different ePIDs, the KMS server is not genuine. -r1 is the the different ePIDs, the KMS server is not genuine. -r1 is the
default mode. -r1 also ensures that all three ePIDs (Windows, default mode. -r1 also ensures that all three ePIDs (Windows,
Office 2010 and Office 2013) use the same OS build number and Office 2010 and Office 2013) use the same OS build number and
LCID (language id). LCID (language id).
If vlmcsd has been started by an internet superserver, -r1 works If vlmcsd has been started by an internet superserver, -r1 works
identically to -r2. This is simply due to the fact that vlmcsd identically to -r2. This is simply due to the fact that vlmcsd
is started upon a connection request and does not stay in memory is started upon a connection request and does not stay in memory
after servicing a KMS request. after servicing a KMS request.
-r2 behaves like most other KMS server emulators with random -r2 behaves like most other KMS server emulators with random
support and generates a new random ePID on every request. Use support and generates a new random ePID on every request. Use
this mode with "care". However since Microsoft currently does this mode with "care". However since Microsoft currently does
not seem to do any verification of the ePID, you currently don't not seem to do any verification of the ePID, you currently don't
need to pay attention to ePIDs at all. need to pay attention to ePIDs at all.
-C LCID -C LCID
Do not randomize the locale id part of the ePID and use LCID Do not randomize the locale id part of the ePID and use LCID
instead. The LCID must be specified as a decimal number, e.g. instead. The LCID must be specified as a decimal number, e.g.
1049 for "Russian - Russia". This option has no effect if the 1049 for "Russian - Russia". This option has no effect if the
ePID is not randomized at all, e.g. if it is selected from the ePID is not randomized at all, e.g. if it is selected from the
command line or an ini file. command line or an ini file.
By default vlmcsd generates a valid locale id that is recognized By default vlmcsd generates a valid locale id that is recognized
by .NET Framework 4.0. This may lead to a locale id which is by .NET Framework 4.0. This may lead to a locale id which is
unlikely to occur in your country, for instance 2155 for "Quecha unlikely to occur in your country, for instance 2155 for "Quecha
- Ecuador". You may want to select the locale id of your country - Ecuador". You may want to select the locale id of your country
instead. See MSDN ⟨http://msdn.microsoft.com/en-us/goglobal/ instead. See MSDN ⟨http://msdn.microsoft.com/en-us/goglobal/
bb964664.aspx⟩ for a list of valid LCIDs. Please note that some bb964664.aspx⟩ for a list of valid LCIDs. Please note that some
of them are not recognized by .NET Framework 4.0. of them are not recognized by .NET Framework 4.0.
Most other KMS emulators use a fixed LCID of 1033 (English - Most other KMS emulators use a fixed LCID of 1033 (English -
US). To achive the same behavior in vlmcsd use -C 1033. US). To achive the same behavior in vlmcsd use -C 1033.
-R renewal-interval -R renewal-interval
Instructs clients to renew activation every renewal-interval. Instructs clients to renew activation every renewal-interval.
The renewal-interval is a number optionally immediately followed The renewal-interval is a number optionally immediately followed
by a letter indicating the unit. Valid unit letters are s (sec by a letter indicating the unit. Valid unit letters are s (sec
onds), m (minutes), h (hours), d (days) and w (weeks). If you do onds), m (minutes), h (hours), d (days) and w (weeks). If you do
not specify a letter, minutes is assumed. not specify a letter, minutes is assumed.
-R3d for instance instructs clients to renew activation every 3 -R3d for instance instructs clients to renew activation every 3
days. The default renewal-interval is 10080 (identical to 7d and days. The default renewal-interval is 10080 (identical to 7d and
1w). 1w).
Due to poor implementation of Microsofts KMS Client it cannot be Due to poor implementation of Microsofts KMS Client it cannot be
guaranteed that activation is renewed on time as specfied by the guaranteed that activation is renewed on time as specfied by the
-R option. Don't care about that. Renewal will happen well -R option. Don't care about that. Renewal will happen well
before your activation expires (usually 180 days). before your activation expires (usually 180 days).
Even though you can specify seconds, the granularity of this Even though you can specify seconds, the granularity of this
option is 1 minute. Seconds are rounded down to the next multi option is 1 minute. Seconds are rounded down to the next multi
ple of 60. ple of 60.
-A activation-interval -A activation-interval
Instructs clients to retry activation every activation-interval Instructs clients to retry activation every activation-interval
if it was unsuccessful, e.g. because it could not reach the if it was unsuccessful, e.g. because it could not reach the
server. The default is 120 (identical to 2h). activation-inter server. The default is 120 (identical to 2h). activation-inter
val follows the same syntax as renewal-interval in the -R val follows the same syntax as renewal-interval in the -R
option. option.
-s Installs vlmcsd as a Windows service. This option only works -s Installs vlmcsd as a Windows service. This option only works
with the native Windows version and Cygwin. Combine -s with with the native Windows version and Cygwin. Combine -s with
other command line options. These will be in effect when you other command line options. These will be in effect when you
start the service. The service automatically starts when you start the service. The service automatically starts when you
reboot your machine. To start it manually, type "net start vlm reboot your machine. To start it manually, type "net start vlm
csd". csd".
If you use Cygwin, you must include your Cygwin system DLL If you use Cygwin, you must include your Cygwin system DLL
directory (usually C:\Cygwin\bin or C:\Cygwin64\bin) into the directory (usually C:\Cygwin\bin or C:\Cygwin64\bin) into the
PATH environment variable or the service will not start. PATH environment variable or the service will not start.
You can reinstall the service anytime using vlmcsd -s again, You can reinstall the service anytime using vlmcsd -s again,
e.g. with a different command line. If the service is running, e.g. with a different command line. If the service is running,
it will be restarted with the new command line. it will be restarted with the new command line.
When using -s the command line is checked for basic syntax When using -s the command line is checked for basic syntax
errors only. For example "vlmcsd -s -L 1.2.3.4" reports no error errors only. For example "vlmcsd -s -L 1.2.3.4" reports no error
but the service will not start if 1.2.3.4 is not an IP address but the service will not start if 1.2.3.4 is not an IP address
on your system. on your system.
-S Uninstalls the vlmcsd service. Works only with the native Win -S Uninstalls the vlmcsd service. Works only with the native Win
dows version and Cygwin. All other options will be ignored if dows version and Cygwin. All other options will be ignored if
you include -S in the command line. you include -S in the command line.
-U [domain\]username -U [domain\]username
Can only be used together with -s. Starts the service as a dif Can only be used together with -s. Starts the service as a dif
ferent user than the local SYSTEM account. This is used to run ferent user than the local SYSTEM account. This is used to run
the service under an account with low privileges. If you omit the service under an account with low privileges. If you omit
the domain, an account from the local computer will be used. the domain, an account from the local computer will be used.
You may use "NT AUTHORITY\NetworkService". This is a pseudo user You may use "NT AUTHORITY\NetworkService". This is a pseudo user
with low privileges. You may also use "NT AUTHORITY\LocalSer with low privileges. You may also use "NT AUTHORITY\LocalSer
vice" which has more privileges but these are of no use for run vice" which has more privileges but these are of no use for run
ning vlmcsd. ning vlmcsd.
@ -399,20 +401,20 @@ OPTIONS
sion for your executable. "NT AUTHORITY\NetworkService" normally sion for your executable. "NT AUTHORITY\NetworkService" normally
has no permission to run binaries from your home directory. has no permission to run binaries from your home directory.
For your convenience you can use the special username "/l" as a For your convenience you can use the special username "/l" as a
shortcut for "NT AUTHORITY\LocalService" and "/n" for "NT shortcut for "NT AUTHORITY\LocalService" and "/n" for "NT
AUTHORITY\NetworkService". "vlmcsd -s -U /n" installs the ser AUTHORITY\NetworkService". "vlmcsd -s -U /n" installs the ser
vice to run as "NT AUTHORITY\NetworkService". vice to run as "NT AUTHORITY\NetworkService".
-W password -W password
Can only be used together with -s. Specifies a password for the Can only be used together with -s. Specifies a password for the
corresponding username you use with -U. SYSTEM, "NT AUTHOR corresponding username you use with -U. SYSTEM, "NT AUTHOR
ITY\NetworkService", "NT AUTHORITY\LocalService" do not require ITY\NetworkService", "NT AUTHORITY\LocalService" do not require
a password. a password.
If you specify a user with even lower privileges than "NT If you specify a user with even lower privileges than "NT
AUTHORITY\NetworkService", you must specify its password. You AUTHORITY\NetworkService", you must specify its password. You
also have to grant the "Log on as a service" right to that user. also have to grant the "Log on as a service" right to that user.
@ -421,50 +423,50 @@ SIGNALS
SIGTERM, SIGINT SIGTERM, SIGINT
These signals cause vlmcsd to exit gracefully. All global sema These signals cause vlmcsd to exit gracefully. All global sema
phores and shared memory pages will be released, the pid file phores and shared memory pages will be released, the pid file
will be unlinked (deleted) and a shutdown message will be will be unlinked (deleted) and a shutdown message will be
logged. logged.
SIGHUP Causes vlmcsd to be restarted completely. This is useful if you SIGHUP Causes vlmcsd to be restarted completely. This is useful if you
started vlmcsd with an ini file. You can modify the ini file started vlmcsd with an ini file. You can modify the ini file
while vlmcsd is running and then sending SIGHUP, e.g. by typing while vlmcsd is running and then sending SIGHUP, e.g. by typing
"killall -SIGHUP vlmcsd" or "kill -SIGHUP `cat /var/run/vlm "killall -SIGHUP vlmcsd" or "kill -SIGHUP `cat /var/run/vlm
csd.pid`". csd.pid`".
The SIGHUP handler has been implemented relatively simple. It is The SIGHUP handler has been implemented relatively simple. It is
virtually the same as stopping vlmcsd and starting it again virtually the same as stopping vlmcsd and starting it again
immediately with the following exceptions: immediately with the following exceptions:
— The new process does not get a new process id. — The new process does not get a new process id.
— If you used a pid file, it is not deleted and recreated — If you used a pid file, it is not deleted and recreated
because the process id stays the same. because the process id stays the same.
— If you used the 'user' and/or 'group' directive in an ini — If you used the 'user' and/or 'group' directive in an ini
file these are ignored. This is because once you switched to file these are ignored. This is because once you switched to
lower privileged users and groups, there is no way back. Any lower privileged users and groups, there is no way back. Any
thing else would be a severe security flaw in the OS. thing else would be a severe security flaw in the OS.
Signaling is not available in the native Windows version and in the Signaling is not available in the native Windows version and in the
Cygwin version when it runs as Windows service. Cygwin version when it runs as Windows service.
SUPPORTED OPERATING SYSTEMS SUPPORTED OPERATING SYSTEMS
vlmcsd compiles and runs on Linux, Windows (no Cygwin required but vlmcsd compiles and runs on Linux, Windows (no Cygwin required but
explicitly supported), Mac OS X, FreeBSD, NetBSD, OpenBSD, Dragonfly explicitly supported), Mac OS X, FreeBSD, NetBSD, OpenBSD, Dragonfly
BSD, Minix, Solaris, OpenIndiana, Android and iOS. Other POSIX or BSD, Minix, Solaris, OpenIndiana, Android and iOS. Other POSIX or
unixoid OSses may work with unmodified sources or may require minor unixoid OSses may work with unmodified sources or may require minor
porting efforts. porting efforts.
SUPPORTED PRODUCTS SUPPORTED PRODUCTS
vlmcsd can answer activation requests for the following products: Win vlmcsd can answer activation requests for the following products: Win
dows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows dows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows
Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows
Server 2012 R2, Office 2010, Project 2010, Visio 2010, Office 2013, Server 2012 R2, Office 2010, Project 2010, Visio 2010, Office 2013,
Project 2013, Visio 2013, Office 2016, Project 2016, Visio 2016. Project 2013, Visio 2013, Office 2016, Project 2016, Visio 2016.
Office, Project and Visio must be volume license versions. Office, Project and Visio must be volume license versions.
@ -476,24 +478,24 @@ FILES
EXAMPLES EXAMPLES
vlmcsd -f vlmcsd -f
Starts vlmcsd in foreground. Useful if you use it for the first Starts vlmcsd in foreground. Useful if you use it for the first
time and want to see what's happening when a client requests time and want to see what's happening when a client requests
activation. activation.
vlmcsd -l /var/log/vlmcsd.log vlmcsd -l /var/log/vlmcsd.log
Starts vlmcsd as a daemon and logs everything to /var/log/vlm Starts vlmcsd as a daemon and logs everything to /var/log/vlm
csd.log. csd.log.
vlmcsd -L 192.168.1.17 vlmcsd -L 192.168.1.17
Starts vlmcsd as a daemon and listens on IP address 192.168.1.17 Starts vlmcsd as a daemon and listens on IP address 192.168.1.17
only. This is useful for routers that have a public and a pri only. This is useful for routers that have a public and a pri
vate IP address to prevent your KMS server from becoming public. vate IP address to prevent your KMS server from becoming public.
vlmcsd -s -U /n -l C:\logs\vlmcsd.log vlmcsd -s -U /n -l C:\logs\vlmcsd.log
Installs vlmcsd as a Windows service with low privileges and Installs vlmcsd as a Windows service with low privileges and
logs everything to C:\logs\vlmcsd.log when the service is logs everything to C:\logs\vlmcsd.log when the service is
started with "net start vlmcsd". started with "net start vlmcsd".
@ -501,18 +503,18 @@ EXAMPLES
BUGS BUGS
An ePID specified in an ini file must not contain spaces. An ePID specified in an ini file must not contain spaces.
The maximum number of -L options in the command line or listen state The maximum number of -L options in the command line or listen state
ments in the inifile is the platform default for FD_SETSIZE. This is 64 ments in the inifile is the platform default for FD_SETSIZE. This is 64
on Windows and 1024 on most Unixes. on Windows and 1024 on most Unixes.
AUTHOR AUTHOR
Written by crony12, Hotbird64 and vityan666. With contributions from Written by crony12, Hotbird64 and vityan666. With contributions from
DougQaid. DougQaid.
CREDITS CREDITS
Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati Thanks to CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Rati
borus, ... borus, ...
@ -521,4 +523,4 @@ SEE ALSO
Hotbird64 September 2015 VLMCSD(8) Hotbird64 June 2016 VLMCSD(8)

207
vlmcsd.c
View File

@ -7,6 +7,10 @@
#error Microsoft RPC is only available on Windows and Cygwin #error Microsoft RPC is only available on Windows and Cygwin
#endif #endif
#if defined(USE_MSRPC) && defined(SIMPLE_SOCKETS)
#error You can only define either USE_MSRPC or SIMPLE_SOCKETS but not both
#endif
#if defined(NO_SOCKETS) && defined(USE_MSRPC) #if defined(NO_SOCKETS) && defined(USE_MSRPC)
#error Cannot use inetd mode with Microsoft RPC #error Cannot use inetd mode with Microsoft RPC
#endif #endif
@ -66,18 +70,20 @@
#include "ntservice.h" #include "ntservice.h"
#include "helpers.h" #include "helpers.h"
#ifdef ENABLE_DEPRECATED_OPTIONS
static const char* const optstring = "N:B:m:t:w:0:3:H:A:R:u:g:L:p:i:P:l:r:U:W:C:F:SsfeDd46VvIqkZ";
#else // !ENABLE_DEPRECATED_OPTIONS
static const char* const optstring = "N:B:m:t:w:0:3:H:A:R:u:g:L:p:i:P:l:r:U:W:C:F:SseDdVvqkZ";
#endif // !ENABLE_DEPRECATED_OPTIONS
static const char* const optstring = "N:B:m:t:w:0:3:H:A:R:u:g:L:p:i:P:l:r:U:W:C:SsfeDd46VvIdqkZ"; #if !defined(NO_SOCKETS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)
#if !defined(NO_SOCKETS)
#if !defined(USE_MSRPC)
static uint_fast8_t maxsockets = 0; static uint_fast8_t maxsockets = 0;
static int_fast8_t haveIPv6Stack = 0;
static int_fast8_t haveIPv4Stack = 0; #ifdef ENABLE_DEPRECATED_OPTIONS
static int_fast8_t v6required = 0; static int_fast8_t v6required = 0;
static int_fast8_t v4required = 0; static int_fast8_t v4required = 0;
#endif // !defined(USE_MSRPC) #endif // ENABLE_DEPRECATED_OPTIONS
#endif // !defined(NO_SOCKETS) #endif // !defined(NO_SOCKETS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)
#ifdef _NTSERVICE #ifdef _NTSERVICE
static int_fast8_t installService = 0; static int_fast8_t installService = 0;
@ -107,11 +113,16 @@ static IniFileParameter_t IniFileParameterList[] =
{ "RandomizationLevel", INI_PARAM_RANDOMIZATION_LEVEL }, { "RandomizationLevel", INI_PARAM_RANDOMIZATION_LEVEL },
{ "LCID", INI_PARAM_LCID }, { "LCID", INI_PARAM_LCID },
# endif // NO_RANDOM_EPID # endif // NO_RANDOM_EPID
# ifdef USE_MSRPC # if !defined(NO_SOCKETS) && (defined(USE_MSRPC) || defined(SIMPLE_SOCKETS))
{ "Port", INI_PARAM_PORT }, { "Port", INI_PARAM_PORT },
# endif // USE_MSRPC # endif // defined(USE_MSRPC) || defined(SIMPLE_SOCKETS)
# if !defined(NO_SOCKETS) && !defined(USE_MSRPC) # if !defined(NO_SOCKETS) && !defined(USE_MSRPC)
# ifndef SIMPLE_SOCKETS
{ "Listen", INI_PARAM_LISTEN }, { "Listen", INI_PARAM_LISTEN },
# endif // SIMPLE_SOCKETS
# if HAVE_FREEBIND
{ "FreeBind", INI_PARAM_FREEBIND },
# endif // HAVE_FREEBIND
# if !defined(NO_LIMIT) && !__minix__ # if !defined(NO_LIMIT) && !__minix__
{ "MaxWorkers", INI_PARAM_MAX_WORKERS }, { "MaxWorkers", INI_PARAM_MAX_WORKERS },
# endif // !defined(NO_LIMIT) && !__minix__ # endif // !defined(NO_LIMIT) && !__minix__
@ -200,10 +211,10 @@ static char GetNumericId(gid_t *restrict id, const char *const c)
gid_t temp; gid_t temp;
temp = (gid_t)strtoll(c, &endptr, 10); temp = (gid_t)strtoll(c, &endptr, 10);
if (!*endptr) *id = temp; if (!*endptr) *id = temp;
if (*endptr || temp == (gid_t)-1) errno = EINVAL;
return *endptr; return *endptr || *id == (gid_t)-1;
} }
@ -267,14 +278,15 @@ static __noreturn void usage()
" -C <LCID>\t\tuse fixed <LCID> in random ePIDs\n" " -C <LCID>\t\tuse fixed <LCID> in random ePIDs\n"
#endif // NO_RANDOM_EPID #endif // NO_RANDOM_EPID
#ifndef NO_SOCKETS #ifndef NO_SOCKETS
#ifndef USE_MSRPC #if !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)
" -4\t\t\tuse IPv4\n"
" -6\t\t\tuse IPv6\n"
" -L <address>[:<port>]\tlisten on IP address <address> with optional <port>\n" " -L <address>[:<port>]\tlisten on IP address <address> with optional <port>\n"
" -P <port>\t\tset TCP port <port> for subsequent -L statements (default 1688)\n" " -P <port>\t\tset TCP port <port> for subsequent -L statements (default 1688)\n"
#else // USE_MSRPC #if HAVE_FREEBIND
" -F0, -F1\t\tdisable/enable binding to foreign IP addresses\n"
#endif // HAVE_FREEBIND
#else // defined(USE_MSRPC) || defined(SIMPLE_SOCKETS)
" -P <port>\t\tuse TCP port <port> (default 1688)\n" " -P <port>\t\tuse TCP port <port> (default 1688)\n"
#endif // USE_MSRPC #endif // defined(USE_MSRPC) || defined(SIMPLE_SOCKETS)
#if !defined(NO_LIMIT) && !__minix__ #if !defined(NO_LIMIT) && !__minix__
" -m <clients>\t\tHandle max. <clients> simultaneously (default no limit)\n" " -m <clients>\t\tHandle max. <clients> simultaneously (default no limit)\n"
#endif // !defined(NO_LIMIT) && !__minix__ #endif // !defined(NO_LIMIT) && !__minix__
@ -293,11 +305,8 @@ static __noreturn void usage()
#endif // NO_LOG #endif // NO_LOG
#ifndef _WIN32 // #ifndef _WIN32 //
" -D run in foreground\n" " -D run in foreground\n"
" -f run in foreground" #else // _WIN32
#ifndef NO_LOG " -D does nothing. Provided for compatibility with POSIX versions only\n"
" and log to stdout"
#endif // NO_LOG
"\n"
#endif // _WIN32 #endif // _WIN32
#endif // NO_SOCKETS #endif // NO_SOCKETS
#ifndef USE_MSRPC #ifndef USE_MSRPC
@ -329,8 +338,10 @@ static __noreturn void usage()
" -q\t\t\tdon't log verbose (default)\n" " -q\t\t\tdon't log verbose (default)\n"
#endif // NO_VERBOSE_LOG #endif // NO_VERBOSE_LOG
#endif // NO_LOG #endif // NO_LOG
" -V display version information and exit" #ifndef NO_VERSION_INFORMATION
"\n", " -V display version information and exit\n"
#endif // NO_VERSION_INFORMATION
,
Version, global_argv[0]); Version, global_argv[0]);
exit(!0); exit(!0);
@ -507,20 +518,21 @@ static BOOL setIniFileParameter(uint_fast8_t id, const char *const iniarg)
# endif // NO_RANDOM_EPID # endif // NO_RANDOM_EPID
# ifdef USE_MSRPC # if (defined(USE_MSRPC) || defined(SIMPLE_SOCKETS)) && !defined(NO_SOCKETS)
case INI_PARAM_PORT: case INI_PARAM_PORT:
defaultport = allocateStringArgument(iniarg); defaultport = allocateStringArgument(iniarg);
break; break;
# endif // USE_MSRPC # endif // (defined(USE_MSRPC) || defined(SIMPLE_SOCKETS)) && !defined(NO_SOCKETS
# if !defined(NO_SOCKETS) && !defined(USE_MSRPC) # if !defined(NO_SOCKETS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)
case INI_PARAM_LISTEN: case INI_PARAM_LISTEN:
maxsockets++; maxsockets++;
return TRUE; return TRUE;
# endif // !defined(NO_SOCKETS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)
# if !defined(NO_LIMIT) && !__minix__ # if !defined(NO_LIMIT) && !__minix__
case INI_PARAM_MAX_WORKERS: case INI_PARAM_MAX_WORKERS:
@ -532,7 +544,6 @@ static BOOL setIniFileParameter(uint_fast8_t id, const char *const iniarg)
break; break;
# endif // !defined(NO_LIMIT) && !__minix__ # endif // !defined(NO_LIMIT) && !__minix__
# endif // NO_SOCKETS
# ifndef NO_PID_FILE # ifndef NO_PID_FILE
@ -593,6 +604,14 @@ static BOOL setIniFileParameter(uint_fast8_t id, const char *const iniarg)
# endif // USE_MSRPC # endif // USE_MSRPC
# if HAVE_FREEBIND
case INI_PARAM_FREEBIND:
success = getIniFileArgumentBool(&freebind, iniarg);
break;
# endif // HAVE_FREEBIND
default: default:
return FALSE; return FALSE;
} }
@ -729,7 +748,7 @@ static BOOL handleIniFileParameter(const char *s)
} }
#if !defined(NO_SOCKETS) && !defined(USE_MSRPC) #if !defined(NO_SOCKETS) && !defined(SIMPLE_SOCKETS) && !defined(USE_MSRPC)
static BOOL setupListeningSocketsFromIniFile(const char *s) static BOOL setupListeningSocketsFromIniFile(const char *s)
{ {
if (!maxsockets) return TRUE; if (!maxsockets) return TRUE;
@ -740,7 +759,7 @@ static BOOL setupListeningSocketsFromIniFile(const char *s)
IniFileErrorMessage = IniFileErrorBuffer; IniFileErrorMessage = IniFileErrorBuffer;
return addListeningSocket(s); return addListeningSocket(s);
} }
#endif // !defined(NO_SOCKETS) && !defined(USE_MSRPC) #endif // !defined(NO_SOCKETS) && !defined(SIMPLE_SOCKETS) && !defined(USE_MSRPC)
static BOOL readIniFile(const uint_fast8_t pass) static BOOL readIniFile(const uint_fast8_t pass)
@ -775,7 +794,7 @@ static BOOL readIniFile(const uint_fast8_t pass)
!setEpidFromIniFileLine(&s, appIndex) || !setEpidFromIniFileLine(&s, appIndex) ||
!setHwIdFromIniFileLine(&s, appIndex); !setHwIdFromIniFileLine(&s, appIndex);
} }
# if !defined(NO_SOCKETS) && !defined(USE_MSRPC) # if !defined(NO_SOCKETS) && !defined(SIMPLE_SOCKETS) && !defined(USE_MSRPC)
else if (pass == INI_FILE_PASS_2) else if (pass == INI_FILE_PASS_2)
{ {
lineParseError = !setupListeningSocketsFromIniFile(s); lineParseError = !setupListeningSocketsFromIniFile(s);
@ -784,7 +803,7 @@ static BOOL readIniFile(const uint_fast8_t pass)
{ {
return FALSE; return FALSE;
} }
# endif // NO_SOCKETS # endif // !defined(NO_SOCKETS) && && !defined(SIMPLE_SOCKETS) && !defined(USE_MSRPC)
if (lineParseError) if (lineParseError)
{ {
@ -1065,10 +1084,21 @@ static void parseGeneralArguments() {
#ifndef NO_SOCKETS #ifndef NO_SOCKETS
#ifndef USE_MSRPC #ifndef USE_MSRPC
#ifdef ENABLE_DEPRECATED_OPTIONS
#ifndef SIMPLE_SOCKETS
case '4': case '4':
case '6': case '6':
printerrorf("Warning: Option -%c is deprecated. Use -L instead.\n", o);
/* no break */
#endif // SIMPLE_SOCKETS
#endif // ENABLE_DEPRECATED_OPTIONS
case 'P': case 'P':
if (o == 'P') defaultport = optarg;
#ifdef SIMPLE_SOCKETS
ignoreIniFileParameter(INI_PARAM_PORT);
#else // !SIMPLE_SOCKETS
ignoreIniFileParameter(INI_PARAM_LISTEN); ignoreIniFileParameter(INI_PARAM_LISTEN);
#endif // !SIMPLE_SOCKETS
break; break;
#else // USE_MSRPC #else // USE_MSRPC
case 'P': case 'P':
@ -1129,19 +1159,44 @@ static void parseGeneralArguments() {
#endif // NO_LOG #endif // NO_LOG
#ifndef NO_SOCKETS #ifndef NO_SOCKETS
#ifndef USE_MSRPC #if !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)
case 'L': case 'L':
maxsockets++; maxsockets++;
ignoreIniFileParameter(INI_PARAM_LISTEN); ignoreIniFileParameter(INI_PARAM_LISTEN);
break; break;
#endif // USE_MSRPC #if HAVE_FREEBIND
case 'F':
if (!getArgumentBool(&freebind, optarg)) usage();
ignoreIniFileParameter(INI_PARAM_FREEBIND);
break;
#endif // HAVE_FREEBIND
#endif // !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)
#if defined(ENABLE_DEPRECATED_OPTIONS)
case 'f': case 'f':
#if !defined(_WIN32) || !defined(NO_LOG)
printerrorf
(
"Warning: Option -f is deprecated. Use -"
#ifdef _WIN32
"e"
#else // !_WIN32
"de"
#endif // !_WIN32
" instead.\n"
);
#ifndef _WIN32
nodaemon = 1; nodaemon = 1;
#endif // _WIN32
#ifndef NO_LOG #ifndef NO_LOG
logstdout = 1; logstdout = 1;
#endif #endif
#if defined(_PEDANTIC) && defined(_WIN32) && defined(NO_LOG)
printerrorf("Warning: Option -f has no effect in a Windows version of vlmcsd that has been compiled with logging disabled.\n");
#endif // defined(_PEDANTIC) && defined(_WIN32) && defined(NO_LOG)
#endif // !defined(_WIN32) || !defined(NO_LOG)
break; break;
#endif // ENABLE_DEPRECATED_OPTIONS
#ifdef _NTSERVICE #ifdef _NTSERVICE
case 'U': case 'U':
@ -1165,7 +1220,13 @@ static void parseGeneralArguments() {
#endif // _NTSERVICE #endif // _NTSERVICE
case 'D': case 'D':
#ifndef _WIN32
nodaemon = 1; nodaemon = 1;
#else // _WIN32
#ifdef _PEDANTIC
printerrorf("Warning: Option -D has no effect in the Windows version of vlmcsd.\n");
#endif // _PEDANTIC
#endif // _WIN32
break; break;
#ifndef NO_LOG #ifndef NO_LOG
@ -1175,10 +1236,10 @@ static void parseGeneralArguments() {
#endif // NO_LOG #endif // NO_LOG
#endif // NO_SOCKETS #endif // NO_SOCKETS
#ifndef _WIN32 #if !defined(_WIN32) && defined(ENABLE_DEPRECATED_OPTIONS)
case 'I': // Backward compatibility with svn681 and earlier case 'I': // Backward compatibility with svn681 and earlier
break; break;
#endif // _WIN32 #endif // !defined(_WIN32) && defined(ENABLE_DEPRECATED_OPTIONS)
#ifndef NO_RANDOM_EPID #ifndef NO_RANDOM_EPID
case 'r': case 'r':
@ -1210,8 +1271,8 @@ static void parseGeneralArguments() {
#endif // NO_SIGHUP #endif // NO_SIGHUP
if (GetGid()) if (GetGid())
{ {
printerrorf("Fatal: setgid for %s failed.\n", optarg); printerrorf("Fatal: %s for %s failed: %s\n", "setgid", gname, strerror(errno));
exit(!0); exit(errno);
} }
break; break;
@ -1223,8 +1284,8 @@ static void parseGeneralArguments() {
#endif // NO_SIGHUP #endif // NO_SIGHUP
if (GetUid()) if (GetUid())
{ {
printerrorf("Fatal: setuid for %s failed.\n", optarg); printerrorf("Fatal: %s for %s failed: %s\n", "setuid", uname, strerror(errno));
exit(!0); exit(errno);
} }
break; break;
#endif // NO_USER_SWITCH && !_WIN32 #endif // NO_USER_SWITCH && !_WIN32
@ -1259,12 +1320,21 @@ static void parseGeneralArguments() {
break; break;
#endif // !USE_MSRPC #endif // !USE_MSRPC
#ifndef NO_VERSION_INFORMATION
case 'V': case 'V':
#ifdef _NTSERVICE #ifdef _NTSERVICE
if (IsNTService) break; if (IsNTService) break;
#endif #endif
printf("vlmcsd %s\n", Version); #if defined(__s390__) && !defined(__zarch__) && !defined(__s390x__)
printf("vlmcsd %s %i-bit\n", Version, sizeof(void*) == 4 ? 31 : (int)sizeof(void*) << 3);
#else
printf("vlmcsd %s %i-bit\n", Version, (int)sizeof(void*) << 3);
#endif // defined(__s390__) && !defined(__zarch__) && !defined(__s390x__)
printPlatform();
printCommonFlags();
printServerFlags();
exit(0); exit(0);
#endif // NO_VERSION_INFORMATION
default: default:
usage(); usage();
@ -1429,7 +1499,7 @@ static void allocateSemaphore(void)
#endif // !defined(NO_LIMIT) && !defined(NO_SOCKETS) && !__minix__ #endif // !defined(NO_LIMIT) && !defined(NO_SOCKETS) && !__minix__
#if !defined(NO_SOCKETS) && !defined(USE_MSRPC) #if !defined(NO_SOCKETS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)
int setupListeningSockets() int setupListeningSockets()
{ {
int o; int o;
@ -1437,14 +1507,16 @@ int setupListeningSockets()
SocketList = (SOCKET*)vlmcsd_malloc((size_t)allocsockets * sizeof(SOCKET)); SocketList = (SOCKET*)vlmcsd_malloc((size_t)allocsockets * sizeof(SOCKET));
haveIPv4Stack = checkProtocolStack(AF_INET); int_fast8_t haveIPv4Stack = checkProtocolStack(AF_INET);
haveIPv6Stack = checkProtocolStack(AF_INET6); int_fast8_t haveIPv6Stack = checkProtocolStack(AF_INET6);
// Reset getopt since we've alread used it // Reset getopt since we've alread used it
optReset(); optReset();
for (opterr = 0; ( o = getopt(global_argc, (char* const*)global_argv, optstring) ) > 0; ) switch (o) for (opterr = 0; ( o = getopt(global_argc, (char* const*)global_argv, optstring) ) > 0; ) switch (o)
{ {
# ifdef ENABLE_DEPRECATED_OPTIONS
case '4': case '4':
if (!haveIPv4Stack) if (!haveIPv4Stack)
@ -1465,18 +1537,19 @@ int setupListeningSockets()
v6required = 1; v6required = 1;
break; break;
case 'L': # endif // ENABLE_DEPRECATED_OPTIONS
addListeningSocket(optarg);
break;
case 'P': case 'P':
defaultport = optarg; defaultport = optarg;
break; break;
default: case 'L':
addListeningSocket(optarg);
break;
default:
break; break;
} }
@ -1498,8 +1571,13 @@ int setupListeningSockets()
// maxsocket results from first pass parsing the arguments // maxsocket results from first pass parsing the arguments
if (!maxsockets) if (!maxsockets)
{ {
# ifdef ENABLE_DEPRECATED_OPTIONS
if (haveIPv6Stack && (v6required || !v4required)) addListeningSocket("::"); if (haveIPv6Stack && (v6required || !v4required)) addListeningSocket("::");
if (haveIPv4Stack && (v4required || !v6required)) addListeningSocket("0.0.0.0"); if (haveIPv4Stack && (v4required || !v6required)) addListeningSocket("0.0.0.0");
# else // !ENABLE_DEPRECATED_OPTIONS
if (haveIPv6Stack) addListeningSocket("::");
if (haveIPv4Stack) addListeningSocket("0.0.0.0");
# endif // !ENABLE_DEPRECATED_OPTIONS
} }
if (!numsockets) if (!numsockets)
@ -1510,7 +1588,7 @@ int setupListeningSockets()
return 0; return 0;
} }
#endif // !defined(NO_SOCKETS) && !defined(USE_MSRPC) #endif // !defined(NO_SOCKETS) && !defined(USE_MSRPC) && !defined(SIMPLE_SOCKETS)
int server_main(int argc, CARGV argv) int server_main(int argc, CARGV argv)
@ -1566,7 +1644,7 @@ int newmain()
#endif // USE_MSRPC #endif // USE_MSRPC
// Windows can never daemonize // Windows can never daemonize
nodaemon = 1; //nodaemon = 1;
#else // __CYGWIN__ #else // __CYGWIN__
@ -1585,7 +1663,9 @@ int newmain()
{ {
InetdMode = 1; InetdMode = 1;
nodaemon = 1; nodaemon = 1;
#ifndef SIMPLE_SOCKETS
maxsockets = 0; maxsockets = 0;
#endif // SIMPLE_SOCKETS
#ifndef NO_LOG #ifndef NO_LOG
logstdout = 0; logstdout = 0;
#endif // NO_LOG #endif // NO_LOG
@ -1614,9 +1694,13 @@ int newmain()
#if !defined(NO_SOCKETS) && !defined(USE_MSRPC) #if !defined(NO_SOCKETS) && !defined(USE_MSRPC)
if (!InetdMode) if (!InetdMode)
{ {
#ifdef SIMPLE_SOCKETS
if ((error = listenOnAllAddresses())) return error;
#else // !SIMPLE_SOCKETS
if ((error = setupListeningSockets())) return error; if ((error = setupListeningSockets())) return error;
#endif // !SIMPLE_SOCKETS
} }
#endif // NO_SOCKETS #endif // !defined(NO_SOCKETS) && !defined(USE_MSRPC)
// After sockets have been set up, we may switch to a lower privileged user // After sockets have been set up, we may switch to a lower privileged user
#if !defined(_WIN32) && !defined(NO_USER_SWITCH) #if !defined(_WIN32) && !defined(NO_USER_SWITCH)
@ -1625,16 +1709,25 @@ int newmain()
if (!IsRestarted) if (!IsRestarted)
{ {
#endif // NO_SIGHUP #endif // NO_SIGHUP
if (gid != INVALID_GID && setgid(gid)) if (gid != INVALID_GID)
{ {
printerrorf("Fatal: setgid for %s failed.\n", gname); if (setgid(gid))
return !0; {
printerrorf("Fatal: %s for %s failed: %s\n", "setgid", gname, strerror(errno));
return errno;
}
if (setgroups(1, &gid))
{
printerrorf("Fatal: %s for %s failed: %s\n", "setgroups", gname, strerror(errno));
return errno;
}
} }
if (uid != INVALID_UID && setuid(uid)) if (uid != INVALID_UID && setuid(uid))
{ {
printerrorf("Fatal: setuid for %s failed.\n", uname); printerrorf("Fatal: %s for %s failed: %s\n", "setuid", uname, strerror(errno));
return !0; return errno;
} }
#ifndef NO_SIGHUP #ifndef NO_SIGHUP
} }

View File

@ -47,6 +47,7 @@ int server_main(int argc, CARGV argv);
#define INI_PARAM_PORT 14 #define INI_PARAM_PORT 14
#define INI_PARAM_RPC_NDR64 15 #define INI_PARAM_RPC_NDR64 15
#define INI_PARAM_RPC_BTFN 16 #define INI_PARAM_RPC_BTFN 16
#define INI_PARAM_FREEBIND 17
#define INI_FILE_PASS_1 1 #define INI_FILE_PASS_1 1
#define INI_FILE_PASS_2 2 #define INI_FILE_PASS_2 2

View File

@ -22,19 +22,23 @@
# Use custom TCP port # Use custom TCP port
# Command line: -P # Command line: -P
# ***The Port directive only works if vlmcsd was compiled to use MS RPC # ***The Port directive only works if vlmcsd was compiled to use MS RPC or simple sockets
# ***Use Listen otherwise # ***Use Listen otherwise
;Port = 1688 ;Port = 1234
# Listen on all IPv4 addresses (default port 1688) # Listen on all IPv4 addresses (default port 1688)
# Command line: -L (and compatibility options -4, -6, -P) # Command line: -L
# Does not work with MS RPC, use Port= # Does not work with MS RPC or simple sockets, use Port=
;Listen = 0.0.0.0:1688 ;Listen = 0.0.0.0:1688
# Listen on all IPv6 addresses (default port 1688) # Listen on all IPv6 addresses (default port 1688)
# Command line: -L (and compatibility options -4, -6, -P) # Command line: -L
;Listen = [::]:1688 ;Listen = [::]:1688
# Allow binding to foreign IP addresses
# Command line: -F0 and -F1
;FreeBind = true
# Randomize ePIDs at program start up (only those that are not explicitly specified) # Randomize ePIDs at program start up (only those that are not explicitly specified)
# Command line: -r # Command line: -r
;RandomizationLevel = 1 ;RandomizationLevel = 1
@ -84,9 +88,9 @@
;group = vlmcsdgroup ;group = vlmcsdgroup
# Disable or enable the NDR64 transfer syntax in RPC (default enabled) # Disable or enable the NDR64 transfer syntax in RPC (default enabled)
# Command line: -n # Command line: -N0 and -B1
;UseNDR64 = true ;UseNDR64 = true
# Disable or enable bind time feature negotiation in RPC (default enabled) # Disable or enable bind time feature negotiation in RPC (default enabled)
# Command line: -b # Command line: -B0 and -B1
;UseBTFN = true ;UseBTFN = true

View File

@ -1,4 +1,4 @@
.TH VLMCSD.INI 5 "September 2015" "Hotbird64" "KMS Activation Manual" .TH VLMCSD.INI 5 "June 2016" "Hotbird64" "KMS Activation Manual"
.LO 8 .LO 8
.SH NAME .SH NAME
@ -34,10 +34,10 @@ Lines, that start with '#' or ';' are treated as comments. Empty lines are ignor
Some \fIargument\fRs are binary arguments that need to be either TRUE or FALSE. You can use "Yes", "On" or "1" as an alias for TRUE and "No", "Off" or "0" as an alias for FALSE. Binary arguments are case-insensitive. Some \fIargument\fRs are binary arguments that need to be either TRUE or FALSE. You can use "Yes", "On" or "1" as an alias for TRUE and "No", "Off" or "0" as an alias for FALSE. Binary arguments are case-insensitive.
.SH KEYWORDS .SH KEYWORDS
The following \fIkeyword\fRs are defined: The following \fIkeyword\fRs are defined (not all keywords may be available depending on the operating system and the options used when \fBvlmcsd\fR(8) was compiled):
.IP "\fBListen\fR" .IP "\fBListen\fR"
This defines on what combinations of IP addresses and ports vlmcsd should listen. \fBListen\fR can be specified more than once. The \fIargument\fR has the form \fIipaddress\fR[:\fIport\fR]. If you omit the \fIport\fR, the default port of 1688 is used. If the \fIipaddress\fR contains colons and a \fIport\fR is used, you must enclose the \fIipaddress\fR in brackets. The default is to listen to 0.0.0.0:1688 and [::]:1688 which means listen to all IPv4 and all IPv6 addresses. See the \fB-L\fR option in \fBvlmcsd\fR(8) for more info about the syntax. If you use \fB-L\fR, \fB-P\fR, \fB-4\fR or \fB-6\fR on the command line, all \fBListen\fR keywords in the ini file will be ignored. The \fBListen\fR keyword cannot be used on Windows and Cygwin if vlmcsd has been compiled to use Microsoft RPC. This defines on what combinations of IP addresses and ports vlmcsd should listen. \fBListen\fR can be specified more than once. The \fIargument\fR has the form \fIipaddress\fR[:\fIport\fR]. If you omit the \fIport\fR, the default port of 1688 is used. If the \fIipaddress\fR contains colons and a \fIport\fR is used, you must enclose the \fIipaddress\fR in brackets. The default is to listen to 0.0.0.0:1688 and [::]:1688 which means listen to all IPv4 and all IPv6 addresses. See the \fB-L\fR option in \fBvlmcsd\fR(8) for more info about the syntax. If you use \fB-L\fR or \fB-P\fR on the command line, all \fBListen\fR keywords in the ini file will be ignored. The \fBListen\fR keyword cannot be used if vlmcsd has been compiled to use Microsoft RPC (Windows and Cygwin only) or simple sockets.
Examples: Examples:
@ -48,7 +48,10 @@ Listen = 0.0.0.0:1234
Listen = [fe80::1721:12ff:fe81:d36b%eth0]:1688 Listen = [fe80::1721:12ff:fe81:d36b%eth0]:1688
.IP "\fBPort\fR" .IP "\fBPort\fR"
Can only be used on Windows and Cygwin if vlmcsd has been compiled to use Microsoft RPC. Causes vlmcsd to listen on that port instead of 1688. On all non-Windows operating systems or if vlmcsd has been compiled to use its own RPC implementation, you must use \fBListen\fR instead. Can only be used if vlmcsd has been compiled to use simple sockets or on Windows and Cygwin if \fBvlmcsd\fR(8) has been compiled to use Microsoft RPC. Otherwise you must use \fBListen\fR instead. Causes vlmcsd to listen on that port instead of 1688.
.IP "\fBFreeBind\fR"
Can be TRUE or FALSE. If TRUE, you can use the \fBListen\fR keyword with IP addresses that are currently not defined on your system. \fBvlmcsd\fR(8) will start listening on these IP addresses as soon as they become available. This keyword is only available under Linux and FreeBSD because no other OS currently supports that feature. FreeBSD supports this only for IPv4 and requires the PRIV_NETINET_BINDANY privilege which is normally assigned to proccesses of the root user.
.IP "\fBUseNDR64\fR" .IP "\fBUseNDR64\fR"
Can be TRUE or FALSE. Specifies whether you want to use the NDR64 transfer syntax. See options \fB-n0\fR and \fB-n1\fR in \fBvlmcsd\fR(8). The default is TRUE. Can be TRUE or FALSE. Specifies whether you want to use the NDR64 transfer syntax. See options \fB-n0\fR and \fB-n1\fR in \fBvlmcsd\fR(8). The default is TRUE.

View File

@ -66,7 +66,9 @@ SYNTAX
KEYWORDS KEYWORDS
The following keywords are defined: The following keywords are defined (not all keywords may be available
depending on the operating system and the options used when vlmcsd(8)
was compiled):
Listen This defines on what combinations of IP addresses and ports vlm Listen This defines on what combinations of IP addresses and ports vlm
@ -77,10 +79,10 @@ KEYWORDS
brackets. The default is to listen to 0.0.0.0:1688 and [::]:1688 brackets. The default is to listen to 0.0.0.0:1688 and [::]:1688
which means listen to all IPv4 and all IPv6 addresses. See the which means listen to all IPv4 and all IPv6 addresses. See the
-L option in vlmcsd(8) for more info about the syntax. If you -L option in vlmcsd(8) for more info about the syntax. If you
use -L, -P, -4 or -6 on the command line, all Listen keywords in use -L or -P on the command line, all Listen keywords in the ini
the ini file will be ignored. The Listen keyword cannot be used file will be ignored. The Listen keyword cannot be used if vlm
on Windows and Cygwin if vlmcsd has been compiled to use Micro csd has been compiled to use Microsoft RPC (Windows and Cygwin
soft RPC. only) or simple sockets.
Examples: Examples:
@ -89,11 +91,21 @@ KEYWORDS
Listen = [fe80::1721:12ff:fe81:d36b%eth0]:1688 Listen = [fe80::1721:12ff:fe81:d36b%eth0]:1688
Port Can only be used on Windows and Cygwin if vlmcsd has been com Port Can only be used if vlmcsd has been compiled to use simple sock
piled to use Microsoft RPC. Causes vlmcsd to listen on that port ets or on Windows and Cygwin if vlmcsd(8) has been compiled to
instead of 1688. On all non-Windows operating systems or if vlm use Microsoft RPC. Otherwise you must use Listen instead. Causes
csd has been compiled to use its own RPC implementation, you vlmcsd to listen on that port instead of 1688.
must use Listen instead.
FreeBind
Can be TRUE or FALSE. If TRUE, you can use the Listen keyword
with IP addresses that are currently not defined on your system.
vlmcsd(8) will start listening on these IP addresses as soon as
they become available. This keyword is only available under
Linux and FreeBSD because no other OS currently supports that
feature. FreeBSD supports this only for IPv4 and requires the
PRIV_NETINET_BINDANY privilege which is normally assigned to
proccesses of the root user.
UseNDR64 UseNDR64
@ -265,4 +277,4 @@ SEE ALSO
Hotbird64 September 2015 VLMCSD.INI(5) Hotbird64 June 2016 VLMCSD.INI(5)

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 --> <!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Tue Mar 8 00:06:22 2016 --> <!-- CreationDate: Sun Jun 5 14:31:11 2016 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
@ -137,7 +137,9 @@ Binary arguments are case-insensitive.</p>
<p style="margin-left:11%; margin-top: 1em">The following <p style="margin-left:11%; margin-top: 1em">The following
<i>keyword</i>s are defined:</p> <i>keyword</i>s are defined (not all keywords may be
available depending on the operating system and the options
used when <b>vlmcsd</b>(8) was compiled):</p>
<table width="100%" border="0" rules="none" frame="void" <table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0"> cellspacing="0" cellpadding="0">
@ -161,11 +163,11 @@ the <i>ipaddress</i> in brackets. The default is to listen
to 0.0.0.0:1688 and [::]:1688 which means listen to all IPv4 to 0.0.0.0:1688 and [::]:1688 which means listen to all IPv4
and all IPv6 addresses. See the <b>-L</b> option in and all IPv6 addresses. See the <b>-L</b> option in
<b>vlmcsd</b>(8) for more info about the syntax. If you use <b>vlmcsd</b>(8) for more info about the syntax. If you use
<b>-L</b>, <b>-P</b>, <b>-4</b> or <b>-6</b> on the command <b>-L</b> or <b>-P</b> on the command line, all
line, all <b>Listen</b> keywords in the ini file will be <b>Listen</b> keywords in the ini file will be ignored. The
ignored. The <b>Listen</b> keyword cannot be used on Windows <b>Listen</b> keyword cannot be used if vlmcsd has been
and Cygwin if vlmcsd has been compiled to use Microsoft compiled to use Microsoft RPC (Windows and Cygwin only) or
RPC.</p> </td></tr> simple sockets.</p></td></tr>
</table> </table>
<p style="margin-left:22%; margin-top: 1em">Examples:</p> <p style="margin-left:22%; margin-top: 1em">Examples:</p>
@ -187,14 +189,25 @@ Listen = [fe80::1721:12ff:fe81:d36b%eth0]:1688</p>
<td width="78%"> <td width="78%">
<p style="margin-top: 1em">Can only be used on Windows and <p style="margin-top: 1em">Can only be used if vlmcsd has
Cygwin if vlmcsd has been compiled to use Microsoft RPC. been compiled to use simple sockets or on Windows and Cygwin
Causes vlmcsd to listen on that port instead of 1688. On all if <b>vlmcsd</b>(8) has been compiled to use Microsoft RPC.
non-Windows operating systems or if vlmcsd has been compiled Otherwise you must use <b>Listen</b> instead. Causes vlmcsd
to use its own RPC implementation, you must use to listen on that port instead of 1688.</p></td></tr>
<b>Listen</b> instead.</p></td></tr>
</table> </table>
<p style="margin-left:11%;"><b>FreeBind</b></p>
<p style="margin-left:22%;">Can be TRUE or FALSE. If TRUE,
you can use the <b>Listen</b> keyword with IP addresses that
are currently not defined on your system. <b>vlmcsd</b>(8)
will start listening on these IP addresses as soon as they
become available. This keyword is only available under Linux
and FreeBSD because no other OS currently supports that
feature. FreeBSD supports this only for IPv4 and requires
the PRIV_NETINET_BINDANY privilege which is normally
assigned to proccesses of the root user.</p>
<p style="margin-left:11%;"><b>UseNDR64</b></p> <p style="margin-left:11%;"><b>UseNDR64</b></p>
<p style="margin-left:22%;">Can be TRUE or FALSE. Specifies <p style="margin-left:22%;">Can be TRUE or FALSE. Specifies

Binary file not shown.

View File

@ -66,7 +66,9 @@ SYNTAX
KEYWORDS KEYWORDS
The following keywords are defined: The following keywords are defined (not all keywords may be available
depending on the operating system and the options used when vlmcsd(8)
was compiled):
Listen This defines on what combinations of IP addresses and ports vlm Listen This defines on what combinations of IP addresses and ports vlm
@ -77,10 +79,10 @@ KEYWORDS
brackets. The default is to listen to 0.0.0.0:1688 and [::]:1688 brackets. The default is to listen to 0.0.0.0:1688 and [::]:1688
which means listen to all IPv4 and all IPv6 addresses. See the which means listen to all IPv4 and all IPv6 addresses. See the
-L option in vlmcsd(8) for more info about the syntax. If you -L option in vlmcsd(8) for more info about the syntax. If you
use -L, -P, -4 or -6 on the command line, all Listen keywords in use -L or -P on the command line, all Listen keywords in the ini
the ini file will be ignored. The Listen keyword cannot be used file will be ignored. The Listen keyword cannot be used if vlm
on Windows and Cygwin if vlmcsd has been compiled to use Micro csd has been compiled to use Microsoft RPC (Windows and Cygwin
soft RPC. only) or simple sockets.
Examples: Examples:
@ -89,11 +91,21 @@ KEYWORDS
Listen = [fe80::1721:12ff:fe81:d36b%eth0]:1688 Listen = [fe80::1721:12ff:fe81:d36b%eth0]:1688
Port Can only be used on Windows and Cygwin if vlmcsd has been com Port Can only be used if vlmcsd has been compiled to use simple sock
piled to use Microsoft RPC. Causes vlmcsd to listen on that port ets or on Windows and Cygwin if vlmcsd(8) has been compiled to
instead of 1688. On all non-Windows operating systems or if vlm use Microsoft RPC. Otherwise you must use Listen instead. Causes
csd has been compiled to use its own RPC implementation, you vlmcsd to listen on that port instead of 1688.
must use Listen instead.
FreeBind
Can be TRUE or FALSE. If TRUE, you can use the Listen keyword
with IP addresses that are currently not defined on your system.
vlmcsd(8) will start listening on these IP addresses as soon as
they become available. This keyword is only available under
Linux and FreeBSD because no other OS currently supports that
feature. FreeBSD supports this only for IPv4 and requires the
PRIV_NETINET_BINDANY privilege which is normally assigned to
proccesses of the root user.
UseNDR64 UseNDR64
@ -265,4 +277,4 @@ SEE ALSO
Hotbird64 September 2015 VLMCSD.INI(5) Hotbird64 June 2016 VLMCSD.INI(5)

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 --> <!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Tue Mar 8 00:06:22 2016 --> <!-- CreationDate: Sun Jun 5 14:31:10 2016 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>

Binary file not shown.

File diff suppressed because it is too large Load Diff