[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <05ace32973590e28f62ccddfd7874cf1fcaca8b1.camel@perches.com>
Date: Wed, 21 Oct 2020 13:36:57 -0700
From: Joe Perches <joe@...ches.com>
To: Aditya <yashsri421@...il.com>
Cc: linux-kernel@...r.kernel.org, lukas.bulwahn@...il.com,
linux-kernel-mentees@...ts.linuxfoundation.org,
dwaipayanray1@...il.com
Subject: Re: [PATCH] checkpatch: fix false positive for REPEATED_WORD warning
On Wed, 2020-10-21 at 12:26 -0700, Joe Perches wrote:
> Perhaps a regex for permissions is good enough
> $line !~ /\b[cbdl-][rwxs-]{9,9}\b/
Maybe not completely correct...
>From info ls:
The file type is one of the following characters:
‘-’
regular file
‘b’
block special file
‘c’
character special file
‘C’
high performance (“contiguous data”) file
‘d’
directory
‘D’
door (Solaris 2.5 and up)
‘l’
symbolic link
‘M’
off-line (“migrated”) file (Cray DMF)
‘n’
network special file (HP-UX)
‘p’
FIFO (named pipe)
‘P’
port (Solaris 10 and up)
‘s’
socket
‘?’
some other file type
The file mode bits listed are similar to symbolic mode
specifications (*note Symbolic Modes::). But ‘ls’ combines
multiple bits into the third character of each set of permissions
as follows:
‘s’
If the set-user-ID or set-group-ID bit and the corresponding
executable bit are both set.
‘S’
If the set-user-ID or set-group-ID bit is set but the
corresponding executable bit is not set.
‘t’
If the restricted deletion flag or sticky bit, and the
other-executable bit, are both set. The restricted deletion
flag is another name for the sticky bit. *Note Mode
Structure::.
‘T’
If the restricted deletion flag or sticky bit is set but the
other-executable bit is not set.
‘x’
If the executable bit is set and none of the above apply.
‘-’
Otherwise.
So apparently to be correct this should be:
$line !~ /\b[bcCdDlMnpPs\?-][rwxsStT-]{9,9}\b/
Powered by blists - more mailing lists