samba36: fix build error with musl
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 41402
This commit is contained in:
parent
78fcf50de4
commit
cdee846385
1 changed files with 11 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
||||||
--- a/source3/Makefile.in
|
--- a/source3/Makefile.in
|
||||||
+++ b/source3/Makefile.in
|
+++ b/source3/Makefile.in
|
||||||
@@ -1019,7 +1019,7 @@ TEST_LP_LOAD_OBJ = param/test_lp_load.o
|
@@ -1019,7 +1019,7 @@ TEST_LP_LOAD_OBJ = param/test_lp_load.o
|
||||||
|
|
||||||
PASSWD_UTIL_OBJ = utils/passwd_util.o
|
PASSWD_UTIL_OBJ = utils/passwd_util.o
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
MULTICALL_O = $(sort $(SMBD_MULTI_O) $(NMBD_MULTI_O) $(SMBPASSWD_MULTI_O) $(MULTI_O))
|
MULTICALL_O = $(sort $(SMBD_MULTI_O) $(NMBD_MULTI_O) $(SMBPASSWD_MULTI_O) $(MULTI_O))
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/source3/utils/owrt_smbpasswd.c
|
+++ b/source3/utils/owrt_smbpasswd.c
|
||||||
@@ -0,0 +1,245 @@
|
@@ -0,0 +1,249 @@
|
||||||
+/*
|
+/*
|
||||||
+ * Copyright (C) 2012 Felix Fietkau <nbd@openwrt.org>
|
+ * Copyright (C) 2012 Felix Fietkau <nbd@openwrt.org>
|
||||||
+ * Copyright (C) 2008 John Crispin <blogic@openwrt.org>
|
+ * Copyright (C) 2008 John Crispin <blogic@openwrt.org>
|
||||||
|
@ -157,20 +157,24 @@
|
||||||
+ int len = strlen(buf);
|
+ int len = strlen(buf);
|
||||||
+
|
+
|
||||||
+ fgetpos(fp, &r_pos);
|
+ fgetpos(fp, &r_pos);
|
||||||
+ w_pos = r_pos;
|
+ fseek(fp, -len, SEEK_CUR);
|
||||||
+ w_pos.__pos -= len;
|
+ fgetpos(fp, &w_pos);
|
||||||
|
+ fsetpos(fp, &r_pos);
|
||||||
+
|
+
|
||||||
+ while (fgets(buf, sizeof(buf) - 1, fp)) {
|
+ while (fgets(buf, sizeof(buf) - 1, fp)) {
|
||||||
+ int cur_len = strlen(buf);
|
+ int cur_len = strlen(buf);
|
||||||
+
|
+
|
||||||
+ fsetpos(fp, &w_pos);
|
+ fsetpos(fp, &w_pos);
|
||||||
+ fputs(buf, fp);
|
+ fputs(buf, fp);
|
||||||
+ r_pos.__pos += cur_len;
|
+ fgetpos(fp, &w_pos);
|
||||||
+ w_pos.__pos += cur_len;
|
+
|
||||||
+ fsetpos(fp, &r_pos);
|
+ fsetpos(fp, &r_pos);
|
||||||
|
+ fseek(fp, cur_len, SEEK_CUR);
|
||||||
|
+ fgetpos(fp, &r_pos);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ ftruncate(fileno(fp), w_pos.__pos);
|
+ fsetpos(fp, &w_pos);
|
||||||
|
+ ftruncate(fileno(fp), ftello(fp));
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static int usage(const char *progname)
|
+static int usage(const char *progname)
|
||||||
|
|
Loading…
Reference in a new issue