Re: what's with that trailing "." for the mode from "ls -l"

2009-11-12 Thread Bryn M. Reeves
On Thu, 2009-11-12 at 08:58 -0500, Robert P. J. Day wrote:
>   that's ok, it was only an issue because of the incredibly hacky way
> that a numeric mode was being reproduced from an existing file -- by
> grabbing the current symbolic mode, then running it through sed to get
> the numeric mode back.  yuck.
> 
>   as someone noted here earlier, using "stat" is way simpler.

If you just need to propagate permissions from one path name to another
you can use chmod directly:

chmod --reference=/path/to/source /path/to/dest

Regards,
Bryn.


-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: what's with that trailing "." for the mode from "ls -l"

2009-11-12 Thread Todd Zullinger
Bryn M. Reeves wrote:
> On Thu, 2009-11-12 at 07:45 -0500, Robert P. J. Day wrote:
[...]
>>   a followup question would be, is there an ls option that would
>>   *prevent* that security setting character from being printed?  i
>>   ask since i'm working with a software project (openembedded) that
>>   specifically takes a mode setting in symbolic mode (from the
>>   output of "ls -l"), and uses sed to translate it to numeric mode,
>>   and the script to do that doesn't take into account that
>>   potential trailing period and promptly converts, say,
>>   "-rwxr-xr-x." to the string "755.", which then causes the
>>   subsequent call to install to crash with a bad numeric mode
>>   argument.
>
> Not that I know of. The "What information is listed" node of the ls
> info pages describes the characters used to indicate alternate
> access methods when listing files with '-l' but does not mention a
> way to suppress this.

I would argue that scraping the ls output in this way is broken and
that openembedded is what should be fixed (using stat as Sanya
suggests is one good alternative).

-- 
ToddOpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~
Honesty may be the best policy, but it's important to remember that
apparently, by elimination, dishonesty is the second-best policy.
-- George Carlin



pgp9Lq34YAKbs.pgp
Description: PGP signature
-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

Re: what's with that trailing "." for the mode from "ls -l"

2009-11-12 Thread Robert P. J. Day
On Thu, 12 Nov 2009, Bryn M. Reeves wrote:

> On Thu, 2009-11-12 at 07:45 -0500, Robert P. J. Day wrote:
> > On Thu, 12 Nov 2009, Bryn M. Reeves wrote:
> >
> > > On Thu, 2009-11-12 at 07:23 -0500, Robert P. J. Day wrote:
> > > > i once knew this, really.  what's the explanation of that recent
> > > > introduction of an extra period after the normal mode bits in the
> > > > output from "ls -l"?
> > >
> > > Let me google that for you:
> > >
> > > http://lmgtfy.com/?q=ls+dot+permissions
> >
> >   a followup question would be, is there an ls option that would
> > *prevent* that security setting character from being printed?  i
> > ask since i'm working with a software project (openembedded) that
> > specifically takes a mode setting in symbolic mode (from the
> > output of "ls -l"), and uses sed to translate it to numeric mode,
> > and the script to do that doesn't take into account that potential
> > trailing period and promptly converts, say, "-rwxr-xr-x." to the
> > string "755.", which then causes the subsequent call to install to
> > crash with a bad numeric mode argument.
>
> Not that I know of. The "What information is listed" node of the ls
> info pages describes the characters used to indicate alternate
> access methods when listing files with '-l' but does not mention a
> way to suppress this.

  that's ok, it was only an issue because of the incredibly hacky way
that a numeric mode was being reproduced from an existing file -- by
grabbing the current symbolic mode, then running it through sed to get
the numeric mode back.  yuck.

  as someone noted here earlier, using "stat" is way simpler.

rday
--


Robert P. J. Day   Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page:  http://crashcourse.ca
Twitter:   http://twitter.com/rpjday


-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: what's with that trailing "." for the mode from "ls -l"

2009-11-12 Thread Bryn M. Reeves
On Thu, 2009-11-12 at 07:45 -0500, Robert P. J. Day wrote:
> On Thu, 12 Nov 2009, Bryn M. Reeves wrote:
> 
> > On Thu, 2009-11-12 at 07:23 -0500, Robert P. J. Day wrote:
> > > i once knew this, really.  what's the explanation of that recent
> > > introduction of an extra period after the normal mode bits in the
> > > output from "ls -l"?
> >
> > Let me google that for you:
> >
> > http://lmgtfy.com/?q=ls+dot+permissions
> 
>   a followup question would be, is there an ls option that would
> *prevent* that security setting character from being printed?  i ask
> since i'm working with a software project (openembedded) that
> specifically takes a mode setting in symbolic mode (from the output of
> "ls -l"), and uses sed to translate it to numeric mode, and the script
> to do that doesn't take into account that potential trailing period
> and promptly converts, say, "-rwxr-xr-x." to the string "755.", which
> then causes the subsequent call to install to crash with a bad numeric
> mode argument.

Not that I know of. The "What information is listed" node of the ls info
pages describes the characters used to indicate alternate access methods
when listing files with '-l' but does not mention a way to suppress
this.

Regards,
Bryn.


-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


RE: what's with that trailing "." for the mode from "ls -l"

2009-11-12 Thread Rajan, S. (Sanya)
Hi,

Instead of parsing the output of ls you could use the stat command:
stat -c %a 

Otherwise, you could try removing the ACL from the files (if you can):
find . -print0 |xargs -0 -n 1 sudo setfattr -h -x security.selinux

Remember that the last character can be:
' ' (blank) no SELinux coverage
'.' (dot) ordinary SELinux context only
'+' (plus) SELinux ACLs or other things beyond ordinary context

Sanya Rajan

-Original Message-
From: fedora-list-boun...@redhat.com [mailto:fedora-list-boun...@redhat.com] On 
Behalf Of Robert P. J. Day
Sent: Thursday, November 12, 2009 2:45 PM
To: Community assistance, encouragement,and advice for using Fedora.
Subject: Re: what's with that trailing "." for the mode from "ls -l"

On Thu, 12 Nov 2009, Bryn M. Reeves wrote:

> On Thu, 2009-11-12 at 07:23 -0500, Robert P. J. Day wrote:
> > i once knew this, really.  what's the explanation of that recent
> > introduction of an extra period after the normal mode bits in the
> > output from "ls -l"?
>
> Let me google that for you:
>
> http://lmgtfy.com/?q=ls+dot+permissions

  a followup question would be, is there an ls option that would
*prevent* that security setting character from being printed?  i ask
since i'm working with a software project (openembedded) that
specifically takes a mode setting in symbolic mode (from the output of
"ls -l"), and uses sed to translate it to numeric mode, and the script
to do that doesn't take into account that potential trailing period
and promptly converts, say, "-rwxr-xr-x." to the string "755.", which
then causes the subsequent call to install to crash with a bad numeric
mode argument.

  right now, an easy solution is to just manually strip the trailing
period in every such case, but it would be easier to replace the
invocation of "ls" with one that just didn't list that period in the
first place.  i don't see such an option in "man ls" or "info ls".
does one exist?

rday
--


Robert P. J. Day   Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page:  http://crashcourse.ca
Twitter:   http://twitter.com/rpjday


-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Nedbank Limited Reg No 1951/09/06. The following link displays the names of 
the Nedbank Board of Directors and Company Secretary. [ 
http://www.nedbank.co.za/terms/DirectorsNedbank.htm ]
This email is confidential and is intended for the addressee only. The 
following link will take you to Nedbank's legal notice. [ 
http://www.nedbank.co.za/terms/EmailDisclaimer.htm ]



-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: what's with that trailing "." for the mode from "ls -l"

2009-11-12 Thread Robert P. J. Day
On Thu, 12 Nov 2009, Bryn M. Reeves wrote:

> On Thu, 2009-11-12 at 07:23 -0500, Robert P. J. Day wrote:
> > i once knew this, really.  what's the explanation of that recent
> > introduction of an extra period after the normal mode bits in the
> > output from "ls -l"?
>
> Let me google that for you:
>
> http://lmgtfy.com/?q=ls+dot+permissions

  a followup question would be, is there an ls option that would
*prevent* that security setting character from being printed?  i ask
since i'm working with a software project (openembedded) that
specifically takes a mode setting in symbolic mode (from the output of
"ls -l"), and uses sed to translate it to numeric mode, and the script
to do that doesn't take into account that potential trailing period
and promptly converts, say, "-rwxr-xr-x." to the string "755.", which
then causes the subsequent call to install to crash with a bad numeric
mode argument.

  right now, an easy solution is to just manually strip the trailing
period in every such case, but it would be easier to replace the
invocation of "ls" with one that just didn't list that period in the
first place.  i don't see such an option in "man ls" or "info ls".
does one exist?

rday
--


Robert P. J. Day   Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page:  http://crashcourse.ca
Twitter:   http://twitter.com/rpjday


-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: what's with that trailing "." for the mode from "ls -l"

2009-11-12 Thread Robert P. J. Day
On Thu, 12 Nov 2009, Bryn M. Reeves wrote:

> On Thu, 2009-11-12 at 07:23 -0500, Robert P. J. Day wrote:
> > i once knew this, really.  what's the explanation of that recent
> > introduction of an extra period after the normal mode bits in the
> > output from "ls -l"?
>
> Let me google that for you:
>
> http://lmgtfy.com/?q=ls+dot+permissions

  actually, i *had* tried google, combinations of "ls" and "mode" and
"dot" and "trailing period" but nothing came up.  weirdly, the one
that finally hit it was :

http://www.google.ca/#hl=en&q=fedora+ls+mode+printed&meta=&aq=&oq=fedora+ls+mode+printed&fp=cf2547b2365d1cd0

no mention of the word "period" at all.  :-)

rday
--


Robert P. J. Day   Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page:  http://crashcourse.ca
Twitter:   http://twitter.com/rpjday


-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: what's with that trailing "." for the mode from "ls -l"

2009-11-12 Thread Bryn M. Reeves
On Thu, 2009-11-12 at 07:23 -0500, Robert P. J. Day wrote:
> i once knew this, really.  what's the explanation of that recent
> introduction of an extra period after the normal mode bits in the
> output from "ls -l"?

Let me google that for you:

http://lmgtfy.com/?q=ls+dot+permissions

Bryn.


-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: what's with that trailing "." for the mode from "ls -l"

2009-11-12 Thread Robert P. J. Day
On Thu, 12 Nov 2009, Robert P. J. Day wrote:

>
>   i once knew this, really.  what's the explanation of that recent
> introduction of an extra period after the normal mode bits in the
> output from "ls -l"?
>
> rday

  never mind, found it:

https://fedoraproject.org/wiki/Fedora_11_FAQ#Why_does_ls_show_a_dot_.28..29_or_a_plus_.28.2B.29_at_the_end_on_the_file_modes_for_some_files.3F

rday
--


Robert P. J. Day   Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page:  http://crashcourse.ca
Twitter:   http://twitter.com/rpjday


-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines