[Samba] Fwd: net rpc lookup from group names that start with "-"

Rowland Penny rowlandpenny241155 at gmail.com
Wed Sep 30 16:04:37 UTC 2015


On 30/09/15 15:59, mathias dufresne wrote:
> I bet that won't work.
> net rpc ..... "\-dash group" -> the shell look into quotes and interpret
> things inside quotes. Because of double quotes. So the shell will interpret
> \- and send only the dash to the command.
>
> net rpc ..... '\-dash group' -> the shell do not interpret things inside
> the quotes, because simple quotes. The shell will send [\-dash group] to
> the command.
>
> This is the same as:
> net rpc ..... "\\-dash group" -> shell interpret \\, transform it into \
> and send \- to the command.
>
> But the point is command is waiting for switches after dashes (-a -o...
> anything to tell the command how to react). The standard to tell commands
> there is no more switches is double dashes "--". And that double dashes
> must be surrounded by spaces to be one word and be correctly interpreted by
> the command.
>

Hi Mathias, This got my interest and after I thought 'why would you be 
daft enough to start any object name with a dash', I wondered if it was 
possible to do what the OP wanted.
I tried to create a group called '-dashtest' and I was able to create it 
(after a couple of attempts). I then added a user to the group, I had to 
resort to ldbedit to do this.
I then tried the command the OP posted and it didn't work (as expected), 
so I tried adding the forwardslash, not really expecting it to work, but 
it did.

Rowland


Rowland



More information about the samba mailing list