Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OP-TEE
busybox
提交
12d97b66
B
busybox
项目概览
OP-TEE
/
busybox
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
busybox
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
12d97b66
编写于
1月 16, 2011
作者:
D
Denys Vlasenko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
apply post-1.18.1 patches, bump version to 1.18.2
Signed-off-by:
N
Denys Vlasenko
<
vda.linux@googlemail.com
>
上级
2a1571bf
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
86 addition
and
87 deletion
+86
-87
Makefile
Makefile
+1
-1
archival/bzip2.c
archival/bzip2.c
+4
-2
archival/cpio.c
archival/cpio.c
+0
-4
archival/libarchive/bz/bzlib.c
archival/libarchive/bz/bzlib.c
+1
-3
libbb/procps.c
libbb/procps.c
+3
-1
modutils/modprobe-small.c
modutils/modprobe-small.c
+4
-2
networking/httpd.c
networking/httpd.c
+1
-0
networking/tftp.c
networking/tftp.c
+12
-27
shell/hush.c
shell/hush.c
+59
-46
util-linux/mkswap.c
util-linux/mkswap.c
+1
-1
未找到文件。
Makefile
浏览文件 @
12d97b66
VERSION
=
1
PATCHLEVEL
=
18
SUBLEVEL
=
1
SUBLEVEL
=
2
EXTRAVERSION
=
NAME
=
Unnamed
...
...
archival/bzip2.c
浏览文件 @
12d97b66
...
...
@@ -128,10 +128,12 @@ IF_DESKTOP(long long) int FAST_FUNC compressStream(unpack_info_t *info UNUSED_PA
break
;
}
#if ENABLE_FEATURE_CLEAN_UP
/* Can't be conditional on ENABLE_FEATURE_CLEAN_UP -
* we are called repeatedly
*/
BZ2_bzCompressEnd
(
strm
);
free
(
iobuf
);
#endif
return
total
;
}
...
...
archival/cpio.c
浏览文件 @
12d97b66
...
...
@@ -308,16 +308,12 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
/* -L makes sense only with -o or -p */
#if !ENABLE_FEATURE_CPIO_O
/* no parameters */
opt_complementary
=
"=0"
;
opt
=
getopt32
(
argv
,
OPTION_STR
,
&
cpio_filename
);
argv
+=
optind
;
if
(
opt
&
CPIO_OPT_FILE
)
{
/* -F */
xmove_fd
(
xopen
(
cpio_filename
,
O_RDONLY
),
STDIN_FILENO
);
}
#else
/* _exactly_ one parameter for -p, thus <= 1 param if -p is allowed */
opt_complementary
=
ENABLE_FEATURE_CPIO_P
?
"?1"
:
"=0"
;
opt
=
getopt32
(
argv
,
OPTION_STR
"oH:"
IF_FEATURE_CPIO_P
(
"p"
),
&
cpio_filename
,
&
cpio_fmt
);
argv
+=
optind
;
if
((
opt
&
(
CPIO_OPT_FILE
|
CPIO_OPT_CREATE
))
==
CPIO_OPT_FILE
)
{
/* -F without -o */
...
...
archival/libarchive/bz/bzlib.c
浏览文件 @
12d97b66
...
...
@@ -361,7 +361,6 @@ int BZ2_bzCompress(bz_stream *strm, int action)
/*---------------------------------------------------*/
#if ENABLE_FEATURE_CLEAN_UP
static
void
BZ2_bzCompressEnd
(
bz_stream
*
strm
)
{
...
...
@@ -372,9 +371,8 @@ void BZ2_bzCompressEnd(bz_stream *strm)
free
(
s
->
arr2
);
free
(
s
->
ftab
);
free
(
s
->
crc32table
);
free
(
s
trm
->
state
);
free
(
s
);
}
#endif
/*---------------------------------------------------*/
...
...
libbb/procps.c
浏览文件 @
12d97b66
...
...
@@ -154,6 +154,7 @@ static unsigned long fast_strtoul_10(char **endptr)
return
n
;
}
# if ENABLE_FEATURE_FAST_TOP
static
long
fast_strtol_10
(
char
**
endptr
)
{
if
(
**
endptr
!=
'-'
)
...
...
@@ -162,6 +163,7 @@ static long fast_strtol_10(char **endptr)
(
*
endptr
)
++
;
return
-
(
long
)
fast_strtoul_10
(
endptr
);
}
# endif
static
char
*
skip_fields
(
char
*
str
,
int
count
)
{
...
...
@@ -448,7 +450,7 @@ procps_status_t* FAST_FUNC procps_scan(procps_status_t* sp, int flags)
//FIXME: is it safe to assume this field exists?
sp
->
last_seen_on_cpu
=
fast_strtoul_10
(
&
cp
);
# endif
#endif
/*
end of !ENABLE_FEATURE_TOP_SMP_PROCESS
*/
#endif
/*
FEATURE_FAST_TOP
*/
#if ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS
sp
->
niceness
=
tasknice
;
...
...
modutils/modprobe-small.c
浏览文件 @
12d97b66
...
...
@@ -844,13 +844,15 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv)
void
*
map
;
len
=
MAXINT
(
ssize_t
);
map
=
xmalloc_
xopen
_read_close
(
*
argv
,
&
len
);
map
=
xmalloc_
open_zipped
_read_close
(
*
argv
,
&
len
);
if
(
init_module
(
map
,
len
,
IF_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE
(
options
?
options
:
""
)
IF_NOT_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE
(
""
)
)
!=
0
)
)
!=
0
)
{
bb_error_msg_and_die
(
"can't insert '%s': %s"
,
*
argv
,
moderror
(
errno
));
}
return
0
;
}
...
...
networking/httpd.c
浏览文件 @
12d97b66
...
...
@@ -1522,6 +1522,7 @@ static NOINLINE void send_file_and_exit(const char *url, int what)
struct
stat
sb
;
fstat
(
fd
,
&
sb
);
file_size
=
sb
.
st_size
;
last_mod
=
sb
.
st_mtime
;
}
else
{
IF_FEATURE_HTTPD_GZIP
(
content_gzip
=
0
;)
fd
=
open
(
url
,
O_RDONLY
);
...
...
networking/tftp.c
浏览文件 @
12d97b66
...
...
@@ -105,39 +105,22 @@ struct BUG_G_too_big {
#define error_pkt_str (error_pkt + 4)
#if ENABLE_FEATURE_TFTP_PROGRESS_BAR
/* SIGALRM logic nicked from the wget applet */
static
void
progress_meter
(
int
flag
)
static
void
tftp_progress_update
(
void
)
{
/* We can be called from signal handler */
int
save_errno
=
errno
;
if
(
flag
==
-
1
)
{
/* first call to progress_meter */
bb_progress_init
(
&
G
.
pmt
);
}
bb_progress_update
(
&
G
.
pmt
,
G
.
file
,
0
,
G
.
pos
,
G
.
size
);
if
(
flag
==
0
)
{
/* last call to progress_meter */
alarm
(
0
);
bb_putchar_stderr
(
'\n'
);
}
else
{
if
(
flag
==
-
1
)
{
/* first call to progress_meter */
signal_SA_RESTART_empty_mask
(
SIGALRM
,
progress_meter
);
}
alarm
(
1
);
}
errno
=
save_errno
;
}
static
void
tftp_progress_init
(
void
)
{
progress_meter
(
-
1
);
bb_progress_init
(
&
G
.
pmt
);
tftp_progress_update
();
}
static
void
tftp_progress_done
(
void
)
{
if
(
G
.
pmt
.
inited
)
progress_meter
(
0
);
if
(
G
.
pmt
.
inited
)
{
tftp_progress_update
();
bb_putchar_stderr
(
'\n'
);
G
.
pmt
.
inited
=
0
;
}
}
#else
# define tftp_progress_init() ((void)0)
...
...
@@ -460,9 +443,10 @@ static int tftp_protocol(
xsendto
(
socket_fd
,
xbuf
,
send_len
,
&
peer_lsa
->
u
.
sa
,
peer_lsa
->
len
);
#if ENABLE_FEATURE_TFTP_PROGRESS_BAR
if
(
ENABLE_TFTP
&&
remote_file
)
{
/* tftp */
if
(
ENABLE_TFTP
&&
remote_file
)
/* tftp */
G
.
pos
=
(
block_nr
-
1
)
*
(
uoff_t
)
blksize
;
}
if
(
G
.
pmt
.
inited
)
tftp_progress_update
();
#endif
/* Was it final ACK? then exit */
if
(
finished
&&
(
opcode
==
TFTP_ACK
))
...
...
@@ -479,6 +463,7 @@ static int tftp_protocol(
case
0
:
retries
--
;
if
(
retries
==
0
)
{
tftp_progress_done
();
bb_error_msg
(
"timeout"
);
goto
ret
;
/* no err packet sent */
}
...
...
shell/hush.c
浏览文件 @
12d97b66
...
...
@@ -913,7 +913,7 @@ static const struct built_in_command bltins2[] = {
*/
#if HUSH_DEBUG
/* prevent disasters with G.debug_indent < 0 */
# define indent() f
printf(stderr
, "%*s", (G.debug_indent * 2) & 0xff, "")
# define indent() f
dprintf(2
, "%*s", (G.debug_indent * 2) & 0xff, "")
# define debug_enter() (G.debug_indent++)
# define debug_leave() (G.debug_indent--)
#else
...
...
@@ -923,56 +923,56 @@ static const struct built_in_command bltins2[] = {
#endif
#ifndef debug_printf
# define debug_printf(...) (indent(), f
printf(stderr
, __VA_ARGS__))
# define debug_printf(...) (indent(), f
dprintf(2
, __VA_ARGS__))
#endif
#ifndef debug_printf_parse
# define debug_printf_parse(...) (indent(), f
printf(stderr
, __VA_ARGS__))
# define debug_printf_parse(...) (indent(), f
dprintf(2
, __VA_ARGS__))
#endif
#ifndef debug_printf_exec
#define debug_printf_exec(...) (indent(), f
printf(stderr
, __VA_ARGS__))
#define debug_printf_exec(...) (indent(), f
dprintf(2
, __VA_ARGS__))
#endif
#ifndef debug_printf_env
# define debug_printf_env(...) (indent(), f
printf(stderr
, __VA_ARGS__))
# define debug_printf_env(...) (indent(), f
dprintf(2
, __VA_ARGS__))
#endif
#ifndef debug_printf_jobs
# define debug_printf_jobs(...) (indent(), f
printf(stderr
, __VA_ARGS__))
# define debug_printf_jobs(...) (indent(), f
dprintf(2
, __VA_ARGS__))
# define DEBUG_JOBS 1
#else
# define DEBUG_JOBS 0
#endif
#ifndef debug_printf_expand
# define debug_printf_expand(...) (indent(), f
printf(stderr
, __VA_ARGS__))
# define debug_printf_expand(...) (indent(), f
dprintf(2
, __VA_ARGS__))
# define DEBUG_EXPAND 1
#else
# define DEBUG_EXPAND 0
#endif
#ifndef debug_printf_varexp
# define debug_printf_varexp(...) (indent(), f
printf(stderr
, __VA_ARGS__))
# define debug_printf_varexp(...) (indent(), f
dprintf(2
, __VA_ARGS__))
#endif
#ifndef debug_printf_glob
# define debug_printf_glob(...) (indent(), f
printf(stderr
, __VA_ARGS__))
# define debug_printf_glob(...) (indent(), f
dprintf(2
, __VA_ARGS__))
# define DEBUG_GLOB 1
#else
# define DEBUG_GLOB 0
#endif
#ifndef debug_printf_list
# define debug_printf_list(...) (indent(), f
printf(stderr
, __VA_ARGS__))
# define debug_printf_list(...) (indent(), f
dprintf(2
, __VA_ARGS__))
#endif
#ifndef debug_printf_subst
# define debug_printf_subst(...) (indent(), f
printf(stderr
, __VA_ARGS__))
# define debug_printf_subst(...) (indent(), f
dprintf(2
, __VA_ARGS__))
#endif
#ifndef debug_printf_clean
# define debug_printf_clean(...) (indent(), f
printf(stderr
, __VA_ARGS__))
# define debug_printf_clean(...) (indent(), f
dprintf(2
, __VA_ARGS__))
# define DEBUG_CLEAN 1
#else
# define DEBUG_CLEAN 0
...
...
@@ -982,9 +982,9 @@ static const struct built_in_command bltins2[] = {
static
void
debug_print_strings
(
const
char
*
prefix
,
char
**
vv
)
{
indent
();
f
printf
(
stderr
,
"%s:
\n
"
,
prefix
);
f
dprintf
(
2
,
"%s:
\n
"
,
prefix
);
while
(
*
vv
)
f
printf
(
stderr
,
" '%s'
\n
"
,
*
vv
++
);
f
dprintf
(
2
,
" '%s'
\n
"
,
*
vv
++
);
}
#else
# define debug_print_strings(prefix, vv) ((void)0)
...
...
@@ -1416,6 +1416,22 @@ static void hush_exit(int exitcode)
builtin_eval
(
argv
);
}
#if ENABLE_FEATURE_CLEAN_UP
{
struct
variable
*
cur_var
;
if
(
G
.
cwd
!=
bb_msg_unknown
)
free
((
char
*
)
G
.
cwd
);
cur_var
=
G
.
top_var
;
while
(
cur_var
)
{
struct
variable
*
tmp
=
cur_var
;
if
(
!
cur_var
->
max_len
)
free
(
cur_var
->
varstr
);
cur_var
=
cur_var
->
next
;
free
(
tmp
);
}
}
#endif
#if ENABLE_HUSH_JOB
fflush_all
();
sigexit
(
-
(
exitcode
&
0xff
));
...
...
@@ -2158,22 +2174,22 @@ static void debug_print_list(const char *prefix, o_string *o, int n)
int
i
=
0
;
indent
();
f
printf
(
stderr
,
"%s: list:%p n:%d string_start:%d length:%d maxlen:%d glob:%d quoted:%d escape:%d
\n
"
,
f
dprintf
(
2
,
"%s: list:%p n:%d string_start:%d length:%d maxlen:%d glob:%d quoted:%d escape:%d
\n
"
,
prefix
,
list
,
n
,
string_start
,
o
->
length
,
o
->
maxlen
,
!!
(
o
->
o_expflags
&
EXP_FLAG_GLOB
),
o
->
has_quoted_part
,
!!
(
o
->
o_expflags
&
EXP_FLAG_ESC_GLOB_CHARS
));
while
(
i
<
n
)
{
indent
();
f
printf
(
stderr
,
" list[%d]=%d '%s' %p
\n
"
,
i
,
(
in
t
)
list
[
i
],
o
->
data
+
(
int
)
list
[
i
]
+
string_start
,
o
->
data
+
(
int
)
list
[
i
]
+
string_start
);
f
dprintf
(
2
,
" list[%d]=%d '%s' %p
\n
"
,
i
,
(
int
)(
uintptr_
t
)
list
[
i
],
o
->
data
+
(
int
)
(
uintptr_t
)
list
[
i
]
+
string_start
,
o
->
data
+
(
int
)
(
uintptr_t
)
list
[
i
]
+
string_start
);
i
++
;
}
if
(
n
)
{
const
char
*
p
=
o
->
data
+
(
int
)
list
[
n
-
1
]
+
string_start
;
const
char
*
p
=
o
->
data
+
(
int
)
(
uintptr_t
)
list
[
n
-
1
]
+
string_start
;
indent
();
f
printf
(
stderr
,
" total_sz:%ld
\n
"
,
(
long
)((
p
+
strlen
(
p
)
+
1
)
-
o
->
data
));
f
dprintf
(
2
,
" total_sz:%ld
\n
"
,
(
long
)((
p
+
strlen
(
p
)
+
1
)
-
o
->
data
));
}
}
#else
...
...
@@ -2672,18 +2688,18 @@ static void debug_print_tree(struct pipe *pi, int lvl)
pin
=
0
;
while
(
pi
)
{
f
printf
(
stderr
,
"%*spipe %d res_word=%s followup=%d %s
\n
"
,
lvl
*
2
,
""
,
f
dprintf
(
2
,
"%*spipe %d res_word=%s followup=%d %s
\n
"
,
lvl
*
2
,
""
,
pin
,
RES
[
pi
->
res_word
],
pi
->
followup
,
PIPE
[
pi
->
followup
]);
prn
=
0
;
while
(
prn
<
pi
->
num_cmds
)
{
struct
command
*
command
=
&
pi
->
cmds
[
prn
];
char
**
argv
=
command
->
argv
;
f
printf
(
stderr
,
"%*s cmd %d assignment_cnt:%d"
,
f
dprintf
(
2
,
"%*s cmd %d assignment_cnt:%d"
,
lvl
*
2
,
""
,
prn
,
command
->
assignment_cnt
);
if
(
command
->
group
)
{
f
printf
(
stderr
,
" group %s: (argv=%p)%s%s
\n
"
,
f
dprintf
(
2
,
" group %s: (argv=%p)%s%s
\n
"
,
CMDTYPE
[
command
->
cmd_type
],
argv
# if !BB_MMU
...
...
@@ -2697,10 +2713,10 @@ static void debug_print_tree(struct pipe *pi, int lvl)
continue
;
}
if
(
argv
)
while
(
*
argv
)
{
f
printf
(
stderr
,
" '%s'"
,
*
argv
);
f
dprintf
(
2
,
" '%s'"
,
*
argv
);
argv
++
;
}
f
printf
(
stderr
,
"
\n
"
);
f
dprintf
(
2
,
"
\n
"
);
prn
++
;
}
pi
=
pi
->
next
;
...
...
@@ -4106,7 +4122,16 @@ static struct pipe *parse_stream(char **pstring,
if
(
IS_NULL_CMD
(
ctx
.
command
)
&&
dest
.
length
==
0
&&
!
dest
.
has_quoted_part
)
{
continue
;
/* This newline can be ignored. But...
* without the below check, interactive shell
* will ignore even lines with bare <newline>,
* and show the continuation prompt:
* ps1_prompt$ <enter>
* ps2> _ <=== wrong prompt, should be ps1
*/
struct
pipe
*
pi
=
ctx
.
list_head
;
if
(
pi
->
num_cmds
!=
0
)
continue
;
}
/* Treat newline as a command separator. */
done_pipe
(
&
ctx
,
PIPE_SEQ
);
...
...
@@ -7445,7 +7470,7 @@ int hush_main(int argc, char **argv)
unsigned
builtin_argc
;
char
**
e
;
struct
variable
*
cur_var
;
struct
variable
shell_ver
;
struct
variable
*
shell_ver
;
INIT_G
();
if
(
EXIT_SUCCESS
)
/* if EXIT_SUCCESS == 0, it is already done */
...
...
@@ -7454,17 +7479,17 @@ int hush_main(int argc, char **argv)
G
.
argv0_for_re_execing
=
argv
[
0
];
#endif
/* Deal with HUSH_VERSION */
memset
(
&
shell_ver
,
0
,
sizeof
(
shell_ver
));
shell_ver
.
flg_export
=
1
;
shell_ver
.
flg_read_only
=
1
;
shell_ver
=
xzalloc
(
sizeof
(
*
shell_ver
));
shell_ver
->
flg_export
=
1
;
shell_ver
->
flg_read_only
=
1
;
/* Code which handles ${var<op>...} needs writable values for all variables,
* therefore we xstrdup: */
shell_ver
.
varstr
=
xstrdup
(
hush_version_str
),
G
.
top_var
=
&
shell_ver
;
shell_ver
->
varstr
=
xstrdup
(
hush_version_str
);
/* Create shell local variables from the values
* currently living in the environment */
debug_printf_env
(
"unsetenv '%s'
\n
"
,
"HUSH_VERSION"
);
unsetenv
(
"HUSH_VERSION"
);
/* in case it exists in initial env */
G
.
top_var
=
shell_ver
;
cur_var
=
G
.
top_var
;
e
=
environ
;
if
(
e
)
while
(
*
e
)
{
...
...
@@ -7479,8 +7504,8 @@ int hush_main(int argc, char **argv)
e
++
;
}
/* (Re)insert HUSH_VERSION into env (AFTER we scanned the env!) */
debug_printf_env
(
"putenv '%s'
\n
"
,
shell_ver
.
varstr
);
putenv
(
shell_ver
.
varstr
);
debug_printf_env
(
"putenv '%s'
\n
"
,
shell_ver
->
varstr
);
putenv
(
shell_ver
->
varstr
);
/* Export PWD */
set_pwd_var
(
/*exp:*/
1
);
...
...
@@ -7840,18 +7865,6 @@ int hush_main(int argc, char **argv)
parse_and_run_file
(
stdin
);
final_return:
#if ENABLE_FEATURE_CLEAN_UP
if
(
G
.
cwd
!=
bb_msg_unknown
)
free
((
char
*
)
G
.
cwd
);
cur_var
=
G
.
top_var
->
next
;
while
(
cur_var
)
{
struct
variable
*
tmp
=
cur_var
;
if
(
!
cur_var
->
max_len
)
free
(
cur_var
->
varstr
);
cur_var
=
cur_var
->
next
;
free
(
tmp
);
}
#endif
hush_exit
(
G
.
last_exitcode
);
}
...
...
util-linux/mkswap.c
浏览文件 @
12d97b66
...
...
@@ -15,7 +15,7 @@ static void mkswap_selinux_setcontext(int fd, const char *path)
if
(
!
is_selinux_enabled
())
return
;
xfstat
(
fd
,
&
stbuf
,
argv
[
0
]
);
xfstat
(
fd
,
&
stbuf
,
path
);
if
(
S_ISREG
(
stbuf
.
st_mode
))
{
security_context_t
newcon
;
security_context_t
oldcon
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录