{"action":"created","issue":{"url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1243","labels_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1243/labels{/name}","comments_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1243/comments","events_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1243/events","html_url":"https://github.com/magnumripper/JohnTheRipper/issues/1243","id":71927664,"number":1243,"title":"In case of errors, error() instead of exit(0) should be used.","user":{"login":"frank-dittrich","id":2026819,"avatar_url":"https://avatars.githubusercontent.com/u/2026819?v=3","gravatar_id":"","url":"https://api.github.com/users/frank-dittrich","html_url":"https://github.com/frank-dittrich","followers_url":"https://api.github.com/users/frank-dittrich/followers","following_url":"https://api.github.com/users/frank-dittrich/following{/other_user}","gists_url":"https://api.github.com/users/frank-dittrich/gists{/gist_id}","starred_url":"https://api.github.com/users/frank-dittrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frank-dittrich/subscriptions","organizations_url":"https://api.github.com/users/frank-dittrich/orgs","repos_url":"https://api.github.com/users/frank-dittrich/repos","events_url":"https://api.github.com/users/frank-dittrich/events{/privacy}","received_events_url":"https://api.github.com/users/frank-dittrich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-29T16:45:43Z","updated_at":"2015-04-29T19:17:35Z","closed_at":null,"body":"I think these code snippets need to be adjusted to use error():\r\n```\r\n john.c:855:                     fprintf(stderr, \"Target encoding can only be specified\"\r\njohn.c-856-                             \" if input encoding is UTF-8\\n\");\r\njohn.c-857-             exit(0);\r\n```\r\n\r\n```\r\njohn.c:1167:            fprintf(stderr, \"Sorry, %s is required for this build\\n\",\r\njohn.c-1168-                CPU_NAME);\r\njohn.c-1169-            if (make_check)\r\njohn.c-1170-                    exit(0);\r\n```\r\n\r\n```\r\njohn.c:1258:                    fprintf(stderr, \"Internal encoding can only be \"\r\njohn.c-1259-                            \"specified if input encoding is UTF-8\\n\");\r\njohn.c-1260-                    exit(0);\r\n```\r\n\r\n```\r\nopencl_rawmd4_fmt_plug.c:360:           fprintf(stderr, \"Something went wrong while loading hashes to gpu..Exiting..\\n\");\r\nopencl_rawmd4_fmt_plug.c-361-           exit(0);\r\n```\r\n\r\n```\r\npp.c:1850:    fprintf(stderr, \"Keyspace size %s (%d bits used)\\n\", l_msg,\r\npp.c-1851-            get_bits(&total_ks_cnt));\r\npp.c-1852-    exit(0);\r\n```\r\n\r\n```\r\nregex.c:265:            fprintf(stderr,\r\nregex.c-266-                    \"--regex need to contain \\\"\\\\0\\\" in combination\"\r\nregex.c-267-                    \" with wordist, or an alpha option\\n\");\r\nregex.c-268-            exit(0);\r\n```"},"comment":{"url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/comments/97548992","html_url":"https://github.com/magnumripper/JohnTheRipper/issues/1243#issuecomment-97548992","issue_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1243","id":97548992,"user":{"login":"magnumripper","id":1268598,"avatar_url":"https://avatars.githubusercontent.com/u/1268598?v=3","gravatar_id":"","url":"https://api.github.com/users/magnumripper","html_url":"https://github.com/magnumripper","followers_url":"https://api.github.com/users/magnumripper/followers","following_url":"https://api.github.com/users/magnumripper/following{/other_user}","gists_url":"https://api.github.com/users/magnumripper/gists{/gist_id}","starred_url":"https://api.github.com/users/magnumripper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magnumripper/subscriptions","organizations_url":"https://api.github.com/users/magnumripper/orgs","repos_url":"https://api.github.com/users/magnumripper/repos","events_url":"https://api.github.com/users/magnumripper/events{/privacy}","received_events_url":"https://api.github.com/users/magnumripper/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T19:17:35Z","updated_at":"2015-04-29T19:17:35Z","body":"We need to understand why Solar opted to use exit(0) (a.k.a. EXIT_SUCCESS) in john.c:1170 before changing it (it's core code).\r\n\r\nThe pp.c thing should really be exit(0) because it's not an error condition at all. Maybe it should print to stdout though, and not stderr.\r\n\r\nFor the rest, I agree."}}