repo.or.cz
/
Samba.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
CVE-2019-14902 dsdb: Ensure we honour both change->force_self and change->force_children
[Samba.git]
/
tests
/
readlink.c
blob
65311c2ff7959cbdc3095182e27dd176d32391c1
1
/* test whether readlink returns a short buffer correctly. */
2
3
#if defined(HAVE_UNISTD_H)
4
#include <unistd.h>
5
#endif
6
7
#include <sys/types.h>
8
#include <sys/stat.h>
9
#include <fcntl.h>
10
11
#define DATA
"readlink.test"
12
#define FNAME
"rdlnk.file"
13
14
int
main
(
void
)
15
{
16
char
buf
[
7
];
17
int
ret
;
18
ssize_t rl_ret
;
19
20
unlink
(
FNAME
);
21
ret
=
symlink
(
DATA
,
FNAME
);
22
if
(
ret
== -
1
) {
23
exit
(
1
);
24
}
25
26
rl_ret
=
readlink
(
FNAME
,
buf
,
sizeof
(
buf
));
27
if
(
rl_ret
== -
1
) {
28
unlink
(
FNAME
);
29
exit
(
1
);
30
}
31
unlink
(
FNAME
);
32
exit
(
0
);
33
}