Lines 68-74
static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
Link Here
|
68 |
int u; |
68 |
int u; |
69 |
|
69 |
|
70 |
memset(&st, 0, sizeof(st)); |
70 |
memset(&st, 0, sizeof(st)); |
71 |
if (stat(path, &st) || trunc) { |
71 |
if (lstat(path, &st) || trunc) { |
72 |
if (type == inode_file) { |
72 |
if (type == inode_file) { |
73 |
einfo("%s: creating file", path); |
73 |
einfo("%s: creating file", path); |
74 |
if (!mode) /* 664 */ |
74 |
if (!mode) /* 664 */ |
Lines 137-142
static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
Link Here
|
137 |
eerror("%s: chmod: %s %s", applet, "Too many hard links to", path); |
137 |
eerror("%s: chmod: %s %s", applet, "Too many hard links to", path); |
138 |
return -1; |
138 |
return -1; |
139 |
} |
139 |
} |
|
|
140 |
if ((type != inode_dir) && (S_ISLNK(st.st_mode))) { |
141 |
eerror("%s: chmod: %s %s", applet, path, " is a symbolic link"); |
142 |
return -1; |
143 |
} |
140 |
einfo("%s: correcting mode", path); |
144 |
einfo("%s: correcting mode", path); |
141 |
if (chmod(path, mode)) { |
145 |
if (chmod(path, mode)) { |
142 |
eerror("%s: chmod: %s", applet, strerror(errno)); |
146 |
eerror("%s: chmod: %s", applet, strerror(errno)); |
Lines 149-154
static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
Link Here
|
149 |
eerror("%s: chown: %s %s", applet, "Too many hard links to", path); |
153 |
eerror("%s: chown: %s %s", applet, "Too many hard links to", path); |
150 |
return -1; |
154 |
return -1; |
151 |
} |
155 |
} |
|
|
156 |
if ((type != inode_dir) && (S_ISLNK(st.st_mode))) { |
157 |
eerror("%s: chown: %s %s", applet, path, " is a symbolic link"); |
158 |
return -1; |
159 |
} |
152 |
einfo("%s: correcting owner", path); |
160 |
einfo("%s: correcting owner", path); |
153 |
if (chown(path, uid, gid)) { |
161 |
if (chown(path, uid, gid)) { |
154 |
eerror("%s: chown: %s", applet, strerror(errno)); |
162 |
eerror("%s: chown: %s", applet, strerror(errno)); |
155 |
- |
|
|