Ticket refs #11405: EX400: some packages are not available because they do not compile

This commit is contained in:
Omar 2017-10-03 18:00:34 +01:00 committed by Sukru Senli
parent 1570a91c9c
commit 54df72b3cc
2 changed files with 43 additions and 1 deletions

View file

@ -55,6 +55,8 @@ define Package/samba2-client
endef
TARGET_CFLAGS += $(FPIC)
WERR := -Werror=format-security
TARGET_CFLAGS_WITHOUT_WERR := $(filter-out $(WERR),$(TARGET_CFLAGS))
define Build/Compile
rm -rf $(PKG_INSTALL_DIR)
@ -93,7 +95,7 @@ define Build/Compile
clean
(cd $(PKG_BUILD_DIR)/source; rm -rf config.{cache,status}; \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE -DNDEBUG -DSHMEM_SIZE=524288 -Dfcntl=fcntl64" \
CFLAGS="$(TARGET_CFLAGS_WITHOUT_WERR) -D_GNU_SOURCE -DNDEBUG -DSHMEM_SIZE=524288" \
CPPFLAGS="$(TARGET_CPPFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS) $(LIBGCC_S)" \
ac_cv_lib_cups_httpConnect=no \

View file

@ -0,0 +1,40 @@
--- a/source/utils/owrt_smbpasswd.c 2017-10-03 15:57:24.190827000 +0100
+++ a/source/utils/owrt_smbpasswd.c 2017-10-03 16:07:54.862857000 +0100
@@ -108,7 +108,7 @@
}
}
- fprintf(fp, line);
+ fprintf(fp, "%s", line);
out:
if(fp)
@@ -134,20 +134,20 @@
p = strchr(t, ':');
if(p && (p - t == strlen(user)) && (strncmp(t, user, strlen(user))) == 0)
{
- fpos_t r_pos, w_pos;
+ long int r_pos, w_pos;
char t2[256];
- fgetpos(fp, &r_pos);
+ r_pos = ftell(fp);
w_pos = r_pos;
- w_pos.__pos -= strlen(t);
+ w_pos -= strlen(t);
while(fgets(t2, 256, fp))
{
- fsetpos(fp, &w_pos);
+ fseek(fp, w_pos, SEEK_SET);
fputs(t2, fp);
- r_pos.__pos += strlen(t2);
- w_pos.__pos += strlen(t2);
- fsetpos(fp, &r_pos);
+ r_pos += strlen(t2);
+ w_pos += strlen(t2);
+ fseek(fp, r_pos, SEEK_SET);
}
- ftruncate(fileno(fp), w_pos.__pos);
+ ftruncate(fileno(fp), w_pos);
break;
}
}