From patchwork Sun Mar 20 18:35:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Pluzhnikov X-Patchwork-Id: 599883 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qSptD0MZVz9s8d for ; Mon, 21 Mar 2016 06:29:07 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=F6Us0tP1; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; q=dns; s=default; b=FuSMUxyjfETPk7weE57Q7/biM+En4 E7Qjjv8YSIlBKN/jaEBNdUQb46bzzp+tqyoaNY3Jg+2E/uSoIbSWL+Gd+1FAB65V V8tbU2bY2v23qlbjoQdOpWVdtcN9fhFrfy0eSNp5eGAE3Hgd75CoZsNhy931pRgu VeWZZ/RQH7ZHI8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; s=default; bh=19DdcdbmFREsz9XUt+te3CFp1Ak=; b=F6U s0tP1r1SggP0X+tqritqWsx92o+Ctzc7DEHbdi/DRMJInz573bKv/6HHv/rYZXfI tIHCzkAYSLwhg6KoVUIKyqfN9iG4Hl6URbw7zhwkz3VVUEp8WtS/X2oYzZiBseQZ 2aqUQmQK5rf+5xqyd5/6UrQ3PNLpsmn+00aYFpKg= Received: (qmail 4488 invoked by alias); 20 Mar 2016 19:27:40 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 15288 invoked by uid 89); 20 Mar 2016 18:38:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 spammy=ACCOUNT, DES, Limit, strlen X-HELO: mail-wm0-f45.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=MDywym3WbNx4QXi9Vz/0zbEg+G3sP50ZGymUd7kjlw0=; b=UF8btDlDGb+mean1PW12AF9Mfdf73eXD975Qp4o7UJzDXT1Vfz59MTgzBk/peZjd9b yNI31VM1N72nTin6aHbhB2Qfkqc72OziGzJrgN/Xp8awdSUgK8CdVRRsUk9cI96f2pDL /YcNzkHdSkIBvpIm7QtIwFfVWvoDpqM5n/ncMbh81dALFuRAT1V6qeBfBlsxOD0qvzUz jCzLtdkIzO6IkWWQOdBhkDWl5MP2xcGSm/fUxbPg0xR4mOHMnfZQtP9OpnvVo0Wc4sJX 7ypKYn0zkDp2ULxIqDrWbFQU2IsUKjIXNNiF7jYmOmnFvJUIBt4gbCrYgIXAwNhtLZne oDhg== X-Gm-Message-State: AD7BkJJf9scBMu58vCTRjEFip10xedr8PZC9mJrNf+BYq4TbQVkMOhe3aZwlkPszV1/px1rU8+GJ6VStXYtddFJr X-Received: by 10.28.153.138 with SMTP id b132mr10222942wme.36.1458498981973; Sun, 20 Mar 2016 11:36:21 -0700 (PDT) MIME-Version: 1.0 From: Paul Pluzhnikov Date: Sun, 20 Mar 2016 11:35:52 -0700 Message-ID: Subject: Delete dead code? [BZ 19653] To: GLIBC Devel , Bill Parker Greetings, Quoting from https://sourceware.org/bugzilla/show_bug.cgi?id=19653 "if this is re-enabled in the future, it could segmentation fault without the check for NULL from malloc()." AFAICT, the code comes from: commit 49633efbcc056cc97928b22ff274b5774839bfae Author: Roland McGrath Date: Wed Jul 26 00:13:55 1995 +0000 New file, based on NET2 code but with DES code removed. and has been ifdef'd out since then. Should we just delete the '#if 0'd blocks? 2016-03-20 Paul Pluzhnikov [BZ 19653] * inet/if_index.c (__protocol_available): Delete. * inet/ruserpass.c (ruserpass): Delete #if 0'd code. Thanks, diff --git a/inet/if_index.c b/inet/if_index.c index b55e427..d8054fc 100644 --- a/inet/if_index.c +++ b/inet/if_index.c @@ -58,14 +58,3 @@ __if_nameindex (void) weak_alias (__if_nameindex, if_nameindex) libc_hidden_weak (if_nameindex) stub_warning (if_nameindex) - -#if 0 -void -internal_function -__protocol_available (int *have_inet, int *have_inet6) -{ - /* By default we assume that IPv4 is available, IPv6 not. */ - *have_inet = 1; - *have_inet6 = 0; -} -#endif diff --git a/inet/ruserpass.c b/inet/ruserpass.c index ff379db..a41668c 100644 --- a/inet/ruserpass.c +++ b/inet/ruserpass.c @@ -196,81 +196,8 @@ next: } break; case ACCOUNT: -#if 0 - if (fstat64(fileno(cfile), &stb) >= 0 - && (stb.st_mode & 077) != 0) { - warnx("Error: .netrc file is readable by others."); - warnx("Remove account or make file unreadable by others."); - goto bad; - } - if (token() && *aacct == 0) { - *aacct = malloc((unsigned) strlen(tokval) + 1); - (void) strcpy(*aacct, tokval); - } -#endif break; case MACDEF: -#if 0 - if (proxy) { - (void) fclose(cfile); - return (0); - } - while ((c=getc_unlocked(cfile)) != EOF && c == ' ' - || c == '\t'); - if (c == EOF || c == '\n') { - printf("Missing macdef name argument.\n"); - goto bad; - } - if (macnum == 16) { - printf("Limit of 16 macros have already been defined\n"); - goto bad; - } - tmp = macros[macnum].mac_name; - *tmp++ = c; - for (i=0; i < 8 && (c=getc_unlocked(cfile)) != EOF && - !isspace(c); ++i) { - *tmp++ = c; - } - if (c == EOF) { - printf("Macro definition missing null line terminator.\n"); - goto bad; - } - *tmp = '\0'; - if (c != '\n') { - while ((c=getc_unlocked(cfile)) != EOF - && c != '\n'); - } - if (c == EOF) { - printf("Macro definition missing null line terminator.\n"); - goto bad; - } - if (macnum == 0) { - macros[macnum].mac_start = macbuf; - } - else { - macros[macnum].mac_start = macros[macnum-1].mac_end + 1; - } - tmp = macros[macnum].mac_start; - while (tmp != macbuf + 4096) { - if ((c=getc_unlocked(cfile)) == EOF) { - printf("Macro definition missing null line terminator.\n"); - goto bad; - } - *tmp = c; - if (*tmp == '\n') { - if (*(tmp-1) == '\0') { - macros[macnum++].mac_end = tmp - 1; - break; - } - *tmp = '\0'; - } - tmp++; - } - if (tmp == macbuf + 4096) { - printf("4K macro buffer exceeded\n"); - goto bad; - } -#endif break; default: warnx(_("Unknown .netrc keyword %s"), tokval);