From: Guido Vranken Date: Sun, 13 Aug 2017 01:42:02 +0000 (+0200) Subject: Resolve merge conflict X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Ffuzzing;p=thirdparty%2Fopenvpn.git Resolve merge conflict --- 6c178b43a33dbe9b980601567ffbbf4f85e805f7 diff --cc src/openvpn/crypto.c index ec85ae4e4,cc3c7b638..e265ac7cb --- a/src/openvpn/crypto.c +++ b/src/openvpn/crypto.c @@@ -1261,9 -1261,9 +1261,9 @@@ read_key_file(struct key2 *key2, const fd = platform_open(file, O_RDONLY, 0); if (fd == -1) { - msg(M_ERR, "Cannot open file key file '%s'", file); + msg(M_ERR, "Cannot open key file '%s'", file); } - size = read(fd, in.data, in.capacity); + size = platform_read(fd, in.data, in.capacity); if (size < 0) { msg(M_FATAL, "Read error on key file ('%s')", file); diff --cc src/openvpn/misc.c index 81b7e6fa4,0adb164e4..92e842eff --- a/src/openvpn/misc.c +++ b/src/openvpn/misc.c @@@ -145,28 -142,7 +145,6 @@@ run_up_down(const char *command gc_free(&gc); } - /* Write our PID to a file */ - void - write_pid(const char *filename) - { - if (filename) - { - unsigned int pid = 0; - FILE *fp = platform_fopen(filename, "w"); - if (!fp) - { - msg(M_ERR, "Open error on pid file %s", filename); - } - - pid = platform_getpid(); - fprintf(fp, "%u\n", pid); - if (platform_fclose(fp)) - { - msg(M_ERR, "Close error on pid file %s", filename); - } - } - } -- /* * Set standard file descriptors to /dev/null */ diff --cc src/openvpn/platform.c index 8db515376,e942ba94a..b35ab11dd --- a/src/openvpn/platform.c +++ b/src/openvpn/platform.c @@@ -188,10 -173,8 +188,10 @@@ platform_nice(int niceval /* Get current PID */ unsigned int - platform_getpid() + platform_getpid(void) { + FUZZING_BLOCK; + #ifdef _WIN32 return (unsigned int) GetCurrentProcessId(); #else diff --cc src/openvpn/tun.c index f001de4ba,3639718c9..ec9d4ec62 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@@ -1862,8 -1861,8 +1862,8 @@@ open_tun(const char *dev, const char *d /* Android 4.4 workaround */ if (oldtunfd >=0 && android_method == ANDROID_OPEN_AFTER_CLOSE) { - close(oldtunfd); + platform_close(oldtunfd); - openvpn_sleep(2); + management_sleep(2); } if (oldtunfd >=0 && android_method == ANDROID_KEEP_OLD_TUN) @@@ -3030,9 -3026,8 +3027,8 @@@ utun_open_helper(struct ctl_info ctlInf if (ioctl(fd, CTLIOCGINFO, &ctlInfo) == -1) { - close(fd); + platform_close(fd); - msg(M_INFO, "Opening utun (%s): %s", "ioctl(CTLIOCGINFO)", - strerror(errno)); + msg(M_INFO | M_ERRNO, "Opening utun (ioctl(CTLIOCGINFO))"); return -2; } @@@ -3050,9 -3045,8 +3046,8 @@@ if (connect(fd, (struct sockaddr *)&sc, sizeof(sc)) < 0) { - msg(M_INFO, "Opening utun (%s): %s", "connect(AF_SYS_CONTROL)", - strerror(errno)); + msg(M_INFO | M_ERRNO, "Opening utun (connect(AF_SYS_CONTROL))"); - close(fd); + platform_close(fd); return -1; }