Cosmetic: unlink_recursive() renamed to mark it is 'suidsafe'.
authorshort <>
Thu, 21 Aug 2003 14:41:34 +0000 (14:41 +0000)
committershort <>
Thu, 21 Aug 2003 14:41:34 +0000 (14:41 +0000)
src/client/sandbox-server/main.c

index 2845366..cab66c7 100644 (file)
@@ -144,14 +144,14 @@ int linkbuflen;
        depth--;
 }
 
-static void unlink_recursive(const gchar *pathname)
+static void unlink_recursive_suidsafe(const gchar *pathname)
 {
 DIR *dir;
 struct dirent *dirent;
 static gint depth=0;
 
        if (++depth>=1000)
-               fatal("Loop count >=%d during unlink_recursive(\"%s\")",depth,pathname);
+               fatal("Loop count >=%d during unlink_recursive_suidsafe(\"%s\")",depth,pathname);
 
        if (!(dir=opendir(pathname))) {
                if (errno!=ENOTDIR)
@@ -167,7 +167,7 @@ gchar *dirent_path;
                if (!strcmp(dirent->d_name,".") || !strcmp(dirent->d_name,".."))
                        continue;
                dirent_path=g_strdup_printf("%s/%s",pathname,dirent->d_name);
-               unlink_recursive(dirent_path);
+               unlink_recursive_suidsafe(dirent_path);
                g_free(dirent_path);
                }
        if (errno)
@@ -186,7 +186,7 @@ static void chrooted_createdir(const gchar *dir,uid_t uid,gid_t gid)
        if (mkdir(dir,0711)) {
                if (errno!=EEXIST)
                        fatal("Failed to create chroot directory \"%s\": %m",dir);
-               unlink_recursive(dir);
+               unlink_recursive_suidsafe(dir);
                if (mkdir(dir,0711))
                        fatal("Failed to create chroot directory \"%s\" after attempted unlink: %m",dir);
                }