mirror of
https://github.com/mintty/wsltty.git
synced 2025-01-18 20:10:58 +00:00
This commit is contained in:
parent
3f60e3f48c
commit
d61e551236
4
makefile
4
makefile
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
# wsltty release
|
# wsltty release
|
||||||
ver=3.0.2
|
ver=3.0.2.2
|
||||||
|
|
||||||
# wsltty appx release - must have 4 parts!
|
# wsltty appx release - must have 4 parts!
|
||||||
verx=3.0.2.2
|
verx=3.0.2.2
|
||||||
@ -121,7 +121,7 @@ wslbridge-package:
|
|||||||
|
|
||||||
wslbridge-source: wslbridge-$(wslbridge-commit).zip
|
wslbridge-source: wslbridge-$(wslbridge-commit).zip
|
||||||
unzip -o wslbridge-$(wslbridge-commit).zip
|
unzip -o wslbridge-$(wslbridge-commit).zip
|
||||||
#cd wslbridge-$(wslbridge-commit)/backend; patch -T -p1 < ../../wslbridge-backend-static.patch
|
cd wslbridge-$(wslbridge-commit)/backend; patch -T -p1 < ../../wslbridge-backend-static.patch
|
||||||
tr -d '\015' < wslbridge-$(wslbridge-commit)/LICENSE.txt > LICENSE.wslbridge
|
tr -d '\015' < wslbridge-$(wslbridge-commit)/LICENSE.txt > LICENSE.wslbridge
|
||||||
|
|
||||||
wslbridge-$(wslbridge-commit).zip:
|
wslbridge-$(wslbridge-commit).zip:
|
||||||
|
@ -1,26 +1,41 @@
|
|||||||
diff -rup orig/Makefile new/Makefile
|
diff -rup old/Makefile new/Makefile
|
||||||
--- orig/Makefile 2018-05-06 01:12:36.000000000 +0200
|
--- old/Makefile 2018-05-06 01:12:36.000000000 +0200
|
||||||
+++ new/Makefile 2019-05-01 08:16:53.647051200 +0200
|
+++ new/Makefile 2019-07-24 22:29:12.874257700 +0200
|
||||||
@@ -5,7 +5,7 @@ all : ../out/wslbridge-backend
|
@@ -8,7 +8,9 @@ all : ../out/wslbridge-backend
|
||||||
../out/wslbridge-backend : wslbridge-backend.cc ../common/SocketIo.cc ../common/SocketIo.h ../VERSION.txt Makefile
|
-static-libgcc -static-libstdc++ \
|
||||||
mkdir -p ../out
|
|
||||||
$(CXX) -std=c++11 -fno-exceptions \
|
|
||||||
- -static-libgcc -static-libstdc++ \
|
|
||||||
+ -static -static-libgcc -static-libstdc++ \
|
|
||||||
-D_GNU_SOURCE \
|
-D_GNU_SOURCE \
|
||||||
-DWSLBRIDGE_VERSION=$(shell cat ../VERSION.txt) \
|
-DWSLBRIDGE_VERSION=$(shell cat ../VERSION.txt) \
|
||||||
-Wall -O2 $< ../common/SocketIo.cc -o $@ -lutil -pthread
|
- -Wall -O2 $< ../common/SocketIo.cc -o $@ -lutil -pthread
|
||||||
diff -rup orig/wslbridge-backend.cc new/wslbridge-backend.cc
|
+ -Wall -O2 $< ../common/SocketIo.cc -o $@ \
|
||||||
--- orig/wslbridge-backend.cc 2018-05-06 01:12:36.000000000 +0200
|
+ -ldl -lutil -static -pthread \
|
||||||
+++ new/wslbridge-backend.cc 2019-05-01 08:19:12.799688500 +0200
|
+ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive
|
||||||
@@ -494,6 +494,45 @@ static void frontendVersionCheck(const c
|
$(STRIP) $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
diff -rup old/wslbridge-backend.cc new/wslbridge-backend.cc
|
||||||
|
--- old/wslbridge-backend.cc 2018-05-06 01:12:36.000000000 +0200
|
||||||
|
+++ new/wslbridge-backend.cc 2019-07-24 22:55:25.324307400 +0200
|
||||||
|
@@ -494,6 +494,58 @@ static void frontendVersionCheck(const c
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
+#define getpwuid _getpwuid
|
+#define getpwuid _getpwuid
|
||||||
+
|
+
|
||||||
|
+#include <dlfcn.h>
|
||||||
|
+typedef struct passwd * (*__getpwuid_t)(int uid);
|
||||||
|
+
|
||||||
+struct passwd * getpwuid(int uid)
|
+struct passwd * getpwuid(int uid)
|
||||||
+{
|
+{
|
||||||
|
+ void * dl = dlopen(0, 0);
|
||||||
|
+printf("dlopen %p\n", dl);
|
||||||
|
+ if (dl) {
|
||||||
|
+ struct passwd * (*__getpwuid)(int uid) =
|
||||||
|
+ (__getpwuid_t)dlsym(dl, "getpwuid");
|
||||||
|
+printf("dlsym %p\n", __getpwuid);
|
||||||
|
+ if (__getpwuid)
|
||||||
|
+ return __getpwuid(uid);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
+ FILE * pwd = fopen("/etc/passwd", "r");
|
+ FILE * pwd = fopen("/etc/passwd", "r");
|
||||||
+ if (pwd) {
|
+ if (pwd) {
|
||||||
+ char pwbuf[222];
|
+ char pwbuf[222];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user