diff -Nur -x '*.orig' -x '*~' policykit-0.7/src/polkit/polkit-policy-cache.c policykit-0.7.new/src/polkit/polkit-policy-cache.c --- policykit-0.7/src/polkit/polkit-policy-cache.c 2007-11-29 07:14:09.000000000 +0100 +++ policykit-0.7.new/src/polkit/polkit-policy-cache.c 2008-01-15 16:59:48.000000000 +0100 @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -99,6 +100,7 @@ { DIR *dir; struct dirent64 *d; + struct stat st; PolKitPolicyCache *pc; dir = NULL; @@ -127,7 +129,7 @@ char *filename; static const char suffix[] = ".policy"; - if (d->d_type != DT_REG) + if (d->d_type != DT_REG && d->d_type != DT_UNKNOWN) continue; filename = d->d_name; @@ -141,6 +143,17 @@ goto out; } + /* we have to check if it's a regular file if readdir() could + * not figure it out */ + if (d->d_type == DT_UNKNOWN) { + if (stat(path, &st) != 0) { + polkit_error_set_error (error, POLKIT_ERROR_POLICY_FILE_INVALID, path); + goto out; + } + if (!S_ISREG(st.st_mode)) + continue; + } + _pk_debug ("Loading %s", path); pk_error = NULL; pf = polkit_policy_file_new (path, load_descriptions, &pk_error); diff -Nur -x '*.orig' -x '*~' policykit-0.7/src/polkit-dbus/polkit-read-auth-helper.c policykit-0.7.new/src/polkit-dbus/polkit-read-auth-helper.c --- policykit-0.7/src/polkit-dbus/polkit-read-auth-helper.c 2007-11-29 05:33:10.000000000 +0100 +++ policykit-0.7.new/src/polkit-dbus/polkit-read-auth-helper.c 2008-01-15 16:59:58.000000000 +0100 @@ -157,6 +157,7 @@ DIR *dir; int dfd; struct dirent64 *d; + struct stat st; polkit_bool_t ret; ret = FALSE; @@ -183,7 +184,7 @@ static const char suffix[] = ".auths"; struct passwd *pw; - if (d->d_type != DT_REG) + if (d->d_type != DT_REG && d->d_type != DT_UNKNOWN) continue; if (d->d_name == NULL) @@ -236,6 +237,18 @@ goto out; } + /* we have to check if it's a regular file if readdir() could + * not figure it out */ + if (d->d_type == DT_UNKNOWN) { + if (stat(path, &st) != 0) { + fprintf (stderr, "polkit-read-auth-helper: could not stat %s: %s\n", + path, strerror (errno)); + goto out; + } + if (!S_ISREG(st.st_mode)) + continue; + } + if (!dump_auths_from_file (path, uid)) goto out; }