543) Added --with-ldap-conf-file option to override /etc/ldap.conf
544) Added SSL tls_* certificate checking options when using LDAP.
+
+545) Sudoedit will now only attempt to edit regular files or links.
#else
if (stat(tf[i].ofile, &sb) != 0) {
#endif
- close(ofd);
+ close(ofd); /* XXX - could reset errno */
ofd = -1;
}
}
continue;
}
memset(&sb, 0, sizeof(sb));
+ } else if (!S_ISREG(sb.st_mode)) {
+ warnx("%s: not a regular file", *ap);
+ close(ofd);
+ argc--;
+ i--;
+ continue;
}
tf[i].ofile = *ap;
tf[i].omtim.tv_sec = mtim_getsec(sb);
}
#ifdef HAVE_FSTAT
if (fstat(tfd, &sb) == 0) {
+ if (!S_ISREG(sb.st_mode)) {
+ warnx("%s: not a regular file", tf[i].tfile);
+ warnx("%s left unmodified", tf[i].ofile);
+ continue;
+ }
if (tf[i].osize == sb.st_size &&
tf[i].omtim.tv_sec == mtim_getsec(sb) &&
tf[i].omtim.tv_nsec == mtim_getnsec(sb)) {