Created
March 12, 2019 06:30
-
-
Save Micrified/00aa24d8bc607a025e13425cbf765b83 to your computer and use it in GitHub Desktop.
Interesting excerp from Cockpit source code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static gboolean | |
validate_path (const gchar *name) | |
{ | |
static const gchar *allowed = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.,/"; | |
gsize len = strspn (name, allowed); | |
return len && name[len] == '\0'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment