summaryrefslogtreecommitdiffstats
path: root/update-ca.c
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2017-11-14 20:03:58 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2017-11-14 20:03:58 +0000
commit69215d7020d4c0346163644cd6669f01a5e6bb7c (patch)
tree0c4293b1f325ce8f686bb8cb61afc0e0e1097b3b /update-ca.c
parentd71632c26f89f98e085f19b1af7176835507a3b7 (diff)
update-ca: remove arbitrary symlink restrictions on local cert dir, entirely pointless
Diffstat (limited to 'update-ca.c')
-rw-r--r--update-ca.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/update-ca.c b/update-ca.c
index 10ebd02..641fd64 100644
--- a/update-ca.c
+++ b/update-ca.c
@@ -253,28 +253,7 @@ static bool read_global_ca_list(const char* file, struct hash* d, int tmpfile_fd
return true;
}
-typedef enum {
- FILE_LINK,
- FILE_REGULAR
-} filetype;
-
-static bool is_filetype(const char* path, filetype file_check)
-{
- struct stat statbuf;
-
- if (lstat(path, &statbuf) < 0)
- return false;
- switch(file_check) {
- case FILE_LINK: return S_ISLNK(statbuf.st_mode);
- case FILE_REGULAR: return S_ISREG(statbuf.st_mode);
- default: break;
- }
-
- return false;
-}
-
static bool dir_readfiles(struct hash* d, const char* path,
- filetype allowed_file_type,
proc_path path_processor,
int tmpfile_fd)
{
@@ -289,9 +268,7 @@ static bool dir_readfiles(struct hash* d, const char* path,
char* fullpath = 0;
if (asprintf(&fullpath, "%s%s", path, dirp->d_name) != -1) {
- if (is_filetype(fullpath, allowed_file_type))
- path_processor(fullpath, d, tmpfile_fd);
-
+ path_processor(fullpath, d, tmpfile_fd);
free(fullpath);
}
}
@@ -334,10 +311,10 @@ int main(int a, char **v)
read_global_ca_list(CERTSCONF, calinks, fd);
/* Handle local CA certificates */
- dir_readfiles(calinks, LOCALCERTSDIR, FILE_REGULAR, &proc_localglobaldir, fd);
+ dir_readfiles(calinks, LOCALCERTSDIR, &proc_localglobaldir, fd);
/* Update etc cert dir for additions and deletions*/
- dir_readfiles(calinks, ETCCERTSDIR, FILE_LINK, &proc_etccertsdir, fd);
+ dir_readfiles(calinks, ETCCERTSDIR, &proc_etccertsdir, fd);
hash_foreach(calinks, update_ca_symlink);
/* Update hashes and the bundle */