|
a/src/utils/wipedir.cpp |
|
b/src/utils/wipedir.cpp |
|
... |
|
... |
39 |
{
|
39 |
{
|
40 |
struct stat st;
|
40 |
struct stat st;
|
41 |
int statret;
|
41 |
int statret;
|
42 |
int ret = -1;
|
42 |
int ret = -1;
|
43 |
|
43 |
|
44 |
statret = stat(dir.c_str(), &st);
|
44 |
statret = lstat(dir.c_str(), &st);
|
45 |
if (statret == -1) {
|
45 |
if (statret == -1) {
|
46 |
LOGERR(("wipedir: cant stat %s, errno %d\n", dir.c_str(), errno));
|
46 |
LOGERR(("wipedir: cant stat %s, errno %d\n", dir.c_str(), errno));
|
47 |
return -1;
|
47 |
return -1;
|
48 |
}
|
48 |
}
|
49 |
if (!S_ISDIR(st.st_mode)) {
|
49 |
if (!S_ISDIR(st.st_mode)) {
|
|
... |
|
... |
68 |
continue;
|
68 |
continue;
|
69 |
|
69 |
|
70 |
string fn = path_cat(dir, ent->d_name);
|
70 |
string fn = path_cat(dir, ent->d_name);
|
71 |
|
71 |
|
72 |
struct stat st;
|
72 |
struct stat st;
|
73 |
int statret = stat(fn.c_str(), &st);
|
73 |
int statret = lstat(fn.c_str(), &st);
|
74 |
if (statret == -1) {
|
74 |
if (statret == -1) {
|
75 |
LOGERR(("wipedir: cant stat %s, errno %d\n", fn.c_str(), errno));
|
75 |
LOGERR(("wipedir: cant stat %s, errno %d\n", fn.c_str(), errno));
|
76 |
goto out;
|
76 |
goto out;
|
77 |
}
|
77 |
}
|
78 |
if (S_ISDIR(st.st_mode)) {
|
78 |
if (S_ISDIR(st.st_mode)) {
|