playground:playground
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
playground:playground [2021/02/18 06:38] – old revision restored (2021/02/11 02:01) 167.114.103.160 | playground:playground [2021/04/25 22:19] – old revision restored (2020/11/19 18:05) 167.114.101.143 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | So easy to set up - just put the allowed uid's into ''/ | ||
- | / | + | -->Title# |
- | retina | + | {{page> |
- | FilesMan | + | <-- |
- | Fuck | + | |
- | cialis | + | |
- | root | + | |
- | rm -rf | + | |
- | crack | + | |
- | hack | + | |
- | sex | + | |
- | <code> | + | |
- | /* @return 0 if filename is foobarable. Otherwise 1. | + | |
- | */ | + | |
- | int is_not_foobar_able( | + | |
- | char *filename, /**< filename IN name of file to test */ | + | |
- | int verbose, | + | |
- | int bufsize | + | |
- | ) | + | |
- | { | + | |
- | struct stat buf; | + | |
- | int retval = 1; | + | |
- | char *bigbuf = NULL; /* just to demonstrate an error return with cleanup */ | + | |
- | if (verbose) printf(" | + | ++++ Title | |
+ | {{page> | ||
+ | ++++ | ||
- | if (stat(filename, | + | < |
- | goto end; /* error return */ | + | {{page> |
- | } | + | </hidden> |
- | + | ||
- | if ((buf.st_mode & S_IFMT) == S_IFREG) | + | |
- | /* it's a regular file */ | + | |
- | if ( !(buf.st_mode & 0111)) | + | |
- | goto end; /* error return */ | + | |
- | | + | |
- | } | + | |
- | + | ||
- | if ((bigbuf = malloc(bufsize)) == NULL) { | + | |
- | fprintf(stderr, | + | |
- | goto end; /* error return */ | + | |
- | } | + | |
- | + | ||
- | ... | + | |
- | + | ||
- | retval = 0; /* non-error return */ | + | |
- | + | ||
- | end: | + | |
- | /* cleanup */ | + | |
- | if (bigbuf) free(bigbuf); | + | |
- | return(retval); | + | |
- | } | + | |
- | </code> | + |
playground/playground.txt · Last modified: 2022/09/03 22:45 (external edit)