|
Lines 160-165
Link Here
|
| 160 |
{ |
160 |
{ |
| 161 |
register int create; |
161 |
register int create; |
| 162 |
register char *tp; |
162 |
register char *tp; |
|
|
163 |
const char *type; |
| 163 |
|
164 |
|
| 164 |
for (; p; p = p->next) { |
165 |
for (; p; p = p->next) { |
| 165 |
if (p->type != F_DIR && (dflag || p->flags & F_VISIT)) |
166 |
if (p->type != F_DIR && (dflag || p->flags & F_VISIT)) |
|
Lines 167-184
Link Here
|
| 167 |
(void)strcpy(tail, p->name); |
168 |
(void)strcpy(tail, p->name); |
| 168 |
if (!(p->flags & F_VISIT)) |
169 |
if (!(p->flags & F_VISIT)) |
| 169 |
(void)printf("missing: %s", path); |
170 |
(void)printf("missing: %s", path); |
| 170 |
if (p->type != F_DIR) { |
171 |
if (p->type != F_DIR && p->type != F_LINK) { |
| 171 |
putchar('\n'); |
172 |
putchar('\n'); |
| 172 |
continue; |
173 |
continue; |
| 173 |
} |
174 |
} |
| 174 |
|
175 |
|
| 175 |
create = 0; |
176 |
create = 0; |
|
|
177 |
if (p->type == F_LINK) |
| 178 |
type = "symlink"; |
| 179 |
else |
| 180 |
type = "directory"; |
| 176 |
if (!(p->flags & F_VISIT) && uflag) |
181 |
if (!(p->flags & F_VISIT) && uflag) |
| 177 |
if (!(p->flags & (F_UID | F_UNAME))) |
182 |
if (!(p->flags & (F_UID | F_UNAME))) |
| 178 |
(void)printf(" (directory not created: user not specified)"); |
183 |
(void)printf(" (%s not created: user not specified)", type); |
| 179 |
else if (!(p->flags & (F_GID | F_GNAME))) |
184 |
else if (!(p->flags & (F_GID | F_GNAME))) |
| 180 |
(void)printf(" (directory not created: group not specified)"); |
185 |
(void)printf(" (%s not created: group not specified)", type); |
| 181 |
else if (!(p->flags & F_MODE)) |
186 |
else if (p->type == F_LINK) { |
|
|
187 |
if (symlink(p->slink, path)) |
| 188 |
(void)printf(" (symlink not created: %s)\n", |
| 189 |
strerror(errno)); |
| 190 |
else |
| 191 |
(void)printf(" (created)\n"); |
| 192 |
if (lchown(path, p->st_uid, p->st_gid)) |
| 193 |
(void)printf("%s: user/group not modified: %s\n", |
| 194 |
path, strerror(errno)); |
| 195 |
continue; |
| 196 |
} else if (!(p->flags & F_MODE)) |
| 182 |
(void)printf(" (directory not created: mode not specified)"); |
197 |
(void)printf(" (directory not created: mode not specified)"); |
| 183 |
else if (mkdir(path, S_IRWXU)) |
198 |
else if (mkdir(path, S_IRWXU)) |
| 184 |
(void)printf(" (directory not created: %s)", |
199 |
(void)printf(" (directory not created: %s)", |