M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
samba_cv_USE_SETREUID=yes
samba_cv_CC_NEGATIVE_ENUM_VALUES=yes
libreplace_cv_HAVE_GETADDRINFO=no
ac_cv_file__proc_sys_kernel_core_pattern=yes
@@ -0,0 +1,24 @@
diff --git a/script/.build_env.sh.swp b/script/.build_env.sh.swp
index b9c3778..f4ebc33 100644
Binary files a/script/.build_env.sh.swp and b/script/.build_env.sh.swp differ
diff --git a/script/build_env.sh b/script/build_env.sh
index eb54f37..6eba89e 100755
--- a/script/build_env.sh
+++ b/script/build_env.sh
@@ -24,6 +24,7 @@ fi
host=`hostname`
+# [jiyu] Modify BUILD_ENV_DATE for lte update
cat <<EOF
/* This file is automatically generated with "make include/build_env.h". DO NOT EDIT */
@@ -31,7 +32,7 @@ cat <<EOF
#define _BUILD_ENV_H
#define BUILD_ENV_UNAME "${uname}"
-#define BUILD_ENV_DATE "${date}"
+#define BUILD_ENV_DATE "Wed Oct 15 10:58:56 CST 2014"
#define BUILD_ENV_SRCDIR "${srcdir}"
#define BUILD_ENV_BUILDDIR "${builddir}"
#define BUILD_ENV_USER "${whoami}"
@@ -0,0 +1,28 @@
diff --git a/lib/system.c b/lib/system.c
--- a/lib/system.c
+++ b/lib/system.c
@@ -690,8 +690,8 @@
/* Make sure the file gets enlarged after we allocated space: */
fstat64(fd, &sbuf);
- if (new_len > sbuf.st_size)
- ftruncate64(fd, new_len);
+ //if (new_len > sbuf.st_size)
+ // ftruncate64(fd, new_len);
return 0;
#else
return ENOSYS;
@@ -740,10 +740,11 @@
int sys_ftruncate(int fd, SMB_OFF_T offset)
{
#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T) && defined(HAVE_FTRUNCATE64)
- return ftruncate64(fd, offset);
+ //return ftruncate64(fd, offset);
#else
- return ftruncate(fd, offset);
+ //return ftruncate(fd, offset);
#endif
+ return 0;
}
/*******************************************************************
+19
View File
@@ -0,0 +1,19 @@
[global]
workgroup = WORKGROUP
netbios name = MIFI
server string = Samba on Mifi
security = share
;socket options = SO_SNDBUF=16384 SO_RCVBUF=16384
;client lanman auth = Yes
;lanman auth = Yes
;client ntlmv2 auth = no
deadtime = 5
;security = share
;guest account = root
[sdcard]
path = /media/card
read only = no
writeable = no
browseable = yes
guest ok = yes
+17
View File
@@ -0,0 +1,17 @@
[global]
workgroup = WORKGROUP
netbios name = MIFI
server string = Samba on Mifi
security = share
;socket options = SO_SNDBUF=16384 SO_RCVBUF=16384
;client lanman auth = Yes
;lanman auth = Yes
;client ntlmv2 auth = no
deadtime = 5
;guest account = root
[sdcard]
path = /media/card
read only = no
writeable = yes
browseable = yes
guest ok = yes
+20
View File
@@ -0,0 +1,20 @@
[global]
interfaces = wlan0 br0
workgroup = WORKGROUP
netbios name = MIFI
server string = Samba on Mifi
security = user
username map = /etc/config/samba/smbusers
encrypt passwords = true
passdb backend = smbpasswd
smb passwd file= /etc/config/samba/smbpasswd
log file = /var/log/samba/log.%m
;socket options = SO_SNDBUF=16384 SO_RCVBUF=16384
[sdcard]
path = /media/card
read only = no
writeable = yes
browseable = yes
public = no
@@ -0,0 +1,75 @@
#!/bin/sh
exec 1>/dev/null 2>&1
SMB_ANONY_RO_CONF=/etc/config/samba/smb_anony_ro.conf
SMB_ANONY_RW_CONF=/etc/config/samba/smb_anony_rw.conf
SMB_SIGNED_CONF=/etc/config/samba/smb_signed_rw.conf
SAMBA_CONF=/etc/config/samba/smb.conf
SMB_USER_FILE=/etc/config/samba/smbusers
SIGNED_SMB_USER=signed_smb
SINGED_SMB_PASSWD=tplink
OWN_NAME=`uci get product.storageshare.own_username`
OWN_PASSWD=`uci get product.storageshare.own_password`
if [ "${OWN_NAME}" = "1" ]
then
VIRTUAL_SMB_NAME=`uci get storageshare.property.username`
else
VIRTUAL_SMB_NAME=`uci get webserver.auth.username`
fi
if [ "${OWN_PASSWD}" = "1" ]
then
VIRTUAL_SMB_PASSWD=`uci get storageshare.property.password`
else
VIRTUAL_SMB_PASSWD=`uci get webserver.auth.password`
fi
# Ensure the daemon has been killed.
echo "stop samba"
stop_samba
# Ensure the dirs need by nmbd and smbd.
echo "mkdir need by nmbd and smbd"
busybox mkdir -p /var/locks
busybox mkdir -p /var/nmbd
busybox mkdir -p /etc/config/samba/private
busybox mkdir -p /var/log/samba
# Clean the log files.
echo "Clean the log files"
busybox rm -rf /var/log/samba/*
# Produce the conf
case "$1" in
anonro)
echo "Produce the anony ro conf"
cat ${SMB_ANONY_RO_CONF} > ${SAMBA_CONF}
;;
anonrw)
echo "Produce the anony rw conf"
cat ${SMB_ANONY_RW_CONF} > ${SAMBA_CONF}
;;
signed)
echo "Produce the signed conf"
cat ${SMB_SIGNED_CONF} > ${SAMBA_CONF}
echo "Ensure the signed_smb user has been add to system"
(echo ${SINGED_SMB_PASSWD};echo ${SINGED_SMB_PASSWD})|adduser $SIGNED_SMB_USER 2>/dev/null
echo "Produce the smbuser file"
echo "${SIGNED_SMB_USER} = ${VIRTUAL_SMB_NAME}" > ${SMB_USER_FILE}
echo "Add smb passwd"
(echo ${VIRTUAL_SMB_PASSWD};echo ${VIRTUAL_SMB_PASSWD})|smbpasswd -s -a $SIGNED_SMB_USER 2>/dev/null
;;
*)
echo "Err: unknown param"
exit 1
;;
esac
# Start the daemons
echo "Start samba"
nmbd -D
smbd -D
exit $?
+62
View File
@@ -0,0 +1,62 @@
#!/bin/sh
exec 1>/dev/null 2>&1
PIDS_SMBD=
PIDS_NMBD=
PIDS_TO_KILL=
kill_pids()
{
PID_TO_KILL=
for PID_TO_KILL in ${PIDS_TO_KILL}
do
kill ${PID_TO_KILL}
echo ${PID_TO_KILL}
done
}
force_kill_pids()
{
PID_TO_KILL=
for PID_TO_KILL in ${PIDS_TO_KILL}
do
kill -9 ${PID_TO_KILL}
echo ${PID_TO_KILL}
done
}
# Try to kill
PIDS_NMBD=`busybox pgrep nmbd | busybox sort -r`
PIDS_SMBD=`busybox pgrep smbd | busybox sort -r`
if busybox test -z "${PIDS_NMBD}"
then
if busybox test -z "${PIDS_SMBD}"
then
exit 0
fi
fi
PIDS_TO_KILL="${PIDS_SMBD}"
kill_pids
PIDS_TO_KILL="${PIDS_NMBD}"
kill_pids
# sleep 1s
sleep 1
# Force to kill
PIDS_NMBD=`busybox pgrep nmbd | busybox sort -r`
PIDS_SMBD=`busybox pgrep smbd | busybox sort -r`
if busybox test -z "${PIDS_NMBD}"
then
if busybox test -z "${PIDS_SMBD}"
then
exit 0
fi
fi
PIDS_TO_KILL="${PIDS_SMBD}"
force_kill_pids
PIDS_TO_KILL="${PIDS_NMBD}"
force_kill_pids
exit 0