From owner-svn-src-stable-10@FreeBSD.ORG Thu May 21 13:36:02 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F65126B; Thu, 21 May 2015 13:36:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F1D01E37; Thu, 21 May 2015 13:36:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4LDa1pL004202; Thu, 21 May 2015 13:36:01 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4LDa1OD004195; Thu, 21 May 2015 13:36:01 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201505211336.t4LDa1OD004195@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 21 May 2015 13:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283238 - stable/10/usr.sbin/autofs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2015 13:36:02 -0000 Author: trasz Date: Thu May 21 13:36:00 2015 New Revision: 283238 URL: https://svnweb.freebsd.org/changeset/base/283238 Log: MFC r279915: Make concat() accept NULL arguments. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/automount.c stable/10/usr.sbin/autofs/automountd.c stable/10/usr.sbin/autofs/common.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/automount.c ============================================================================== --- stable/10/usr.sbin/autofs/automount.c Thu May 21 13:34:33 2015 (r283237) +++ stable/10/usr.sbin/autofs/automount.c Thu May 21 13:36:00 2015 (r283238) @@ -345,11 +345,7 @@ main_automount(int argc, char **argv) force_unmount = true; break; case 'o': - if (options == NULL) { - options = checked_strdup(optarg); - } else { - options = concat(options, ',', optarg); - } + options = concat(options, ',', optarg); break; case 'u': do_unmount = true; @@ -385,9 +381,7 @@ main_automount(int argc, char **argv) parse_master(root, AUTO_MASTER_PATH); if (show_maps) { - if (options != NULL) { - root->n_options = concat(options, ',', root->n_options); - } + root->n_options = concat(options, ',', root->n_options); if (show_maps > 1) { node_expand_indirect_maps(root); node_expand_ampersand(root, NULL); Modified: stable/10/usr.sbin/autofs/automountd.c ============================================================================== --- stable/10/usr.sbin/autofs/automountd.c Thu May 21 13:34:33 2015 (r283237) +++ stable/10/usr.sbin/autofs/automountd.c Thu May 21 13:36:00 2015 (r283238) @@ -241,8 +241,7 @@ handle_request(const struct autofs_daemo /* * Prepend options passed via automountd(8) command line. */ - if (cmdline_options != NULL) - options = concat(cmdline_options, ',', options); + options = concat(cmdline_options, ',', options); if (node->n_location == NULL) { log_debugx("found node defined at %s:%d; not a mountpoint", @@ -455,11 +454,7 @@ main_automountd(int argc, char **argv) maxproc = atoi(optarg); break; case 'o': - if (options == NULL) { - options = checked_strdup(optarg); - } else { - options = concat(options, ',', optarg); - } + options = concat(options, ',', optarg); break; case 'v': debug++; Modified: stable/10/usr.sbin/autofs/common.c ============================================================================== --- stable/10/usr.sbin/autofs/common.c Thu May 21 13:34:33 2015 (r283237) +++ stable/10/usr.sbin/autofs/common.c Thu May 21 13:36:00 2015 (r283238) @@ -94,8 +94,10 @@ concat(const char *s1, char separator, c char *result; int ret; - assert(s1 != NULL); - assert(s2 != NULL); + if (s1 == NULL) + s1 = ""; + if (s2 == NULL) + s2 = ""; /* * If s2 starts with separator - skip it; otherwise concatenating