Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <sys/socket.h>
- #include <errno.h>
- int main()
- {
- for (int i = 0; i <= 256; i++)
- {
- errno = 0;
- int s = socket(i,0,0);
- if (s == -1) {
- if (errno == 97) {continue;}
- if (errno == 1) {printf("socket(%02i) -> %03i: This user does not have access to this socket.\n",i,errno); continue;}
- }
- printf("socket(%02i) -> %03i: This user has access to this socket.\n",i,errno);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment