Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Provision-Unix CPAN distribution.

Report information
The Basics
Id: 62315
Status: resolved
Worked: 1 min
Priority: 0/
Queue: Provision-Unix

People
Owner: Nobody in particular
Requestors: FERRENCY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Re: FreeBSD: Gecos field isn't quoted correctly
Date: Wed, 20 Oct 2010 10:31:23 -0400 (EDT)
To: Matt Simerson via RT <bug-Provision-Unix [...] rt.cpan.org>
From: FERRENCY [...] cpan.org
Thanks! For future reference: it was also pointed out to me that "Peter O'Toole" will break the Gecos field quoting; but at least at this point it works just as well in FreeBSD as it does in Linux. Alan On Wed, 20 Oct 2010, Matt Simerson via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=62282 > > > > Patch applied. Thanks. > > v 0.99 uploaded to CPAN. > > Matt > > On Oct 19, 2010, at 11:38 AM, Alan Ferrency via RT wrote: >
>> Tue Oct 19 14:38:13 2010: Request 62282 was acted upon. >> Transaction: Ticket created by FERRENCY >> Queue: Provision-Unix >> Subject: FreeBSD: Gecos field isn't quoted correctly >> Broken in: 0.98 >> Severity: Normal >> Owner: Nobody >> Requestors: FERRENCY@cpan.org >> Status: new >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=62282 > >> >> >> Hello, >> >> Under FreeBSD, the gecos field is not quoted on the $pwcmd command line >> the way it is in the Linux code. This causes problems for setting up >> Gecos fields in FreeBSD when they contain spaces. >> >> I've attached a patch below to fix this. >> >> Thanks! >> >> Alan Ferrency >> pair Networks, Inc. >> >> >> *** /usr/local/lib/perl5/site_perl/5.8.9/Provision/Unix/User/FreeBSD.pm >> Wed Jun 2 11:57:38 2010 >> --- /usr/local/lib/perl5/site_perl/5.8.9/Provision/Unix/User/FreeBSD.pm~ >> Tue Oct 19 13:48:33 2010 >> *************** >> *** 93 **** >> ! $pwcmd .= "-c $p{'gecos'} " if $p{'gecos'}; >> --- 93 ---- >> ! $pwcmd .= "-c '$p{'gecos'}' " if $p{'gecos'}; >>
> > > >
Subject: Re: [rt.cpan.org #62315] Re: FreeBSD: Gecos field isn't quoted correctly
Date: Wed, 20 Oct 2010 09:20:55 -0700
To: bug-Provision-Unix [...] rt.cpan.org
From: Matt Simerson <matt [...] tnpi.net>
The string could be further modified to this: $pwcmd .= "-c \"$p{'gecos'}\" " if $p{'gecos'}; That would solve the quoting issue for any common usages. The rest of the solution is to also strip out any instances of " that wander into the string: + if ( $p{'gecos'} ) { + $p{'gecos'} =~ s/"//g; + $pwcmd .= "-c \"$p{'gecos'}\" "; + }; Matt On Oct 20, 2010, at 7:31 AM, Alan Ferrency via RT wrote: Show quoted text
> Thanks! > > For future reference: it was also pointed out to me that "Peter O'Toole" > will break the Gecos field quoting; but at least at this point it works > just as well in FreeBSD as it does in Linux. > > Alan
Subject: Re: [rt.cpan.org #62315] Re: FreeBSD: Gecos field isn't quoted correctly
Date: Wed, 20 Oct 2010 13:03:43 -0400 (EDT)
To: Matt Simerson via RT <bug-Provision-Unix [...] rt.cpan.org>
From: FERRENCY [...] cpan.org
How you handle this is up to you. If I were doing this in our code I'd use String::Shellquote. However, you may not want to add a dependency to another CPAN module. http://search.cpan.org/~rosch/String-ShellQuote-1.04/ShellQuote.pm Alan On Wed, 20 Oct 2010, Matt Simerson via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=62315 > > > > The string could be further modified to this: > > $pwcmd .= "-c \"$p{'gecos'}\" " if $p{'gecos'}; > > That would solve the quoting issue for any common usages. The rest of the solution is to also strip out any instances of " that wander into the string: > > + if ( $p{'gecos'} ) { > + $p{'gecos'} =~ s/"//g; > + $pwcmd .= "-c \"$p{'gecos'}\" "; > + }; > > > Matt > > On Oct 20, 2010, at 7:31 AM, Alan Ferrency via RT wrote: >
>> Thanks! >> >> For future reference: it was also pointed out to me that "Peter O'Toole" >> will break the Gecos field quoting; but at least at this point it works >> just as well in FreeBSD as it does in Linux. >> >> Alan
> > > >
fixed in 0.99 release. confirmed after 1.01