tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

find(1) and group/user handling

WRT to your (kre's) PR bin/46158, I have to wonder ...

Assume there is an entry in the password database for a username "123"
but with uid value of 456.  If find is invoked with '-user 123' should
we match this pw entry and compare the file's numeric owner with 456?
Or should find(1) treat an all-numeric username strictly as a number,
and compare in this case against 123?

In the latter case, it makes sense to allow the plus/minus prefix.

But if we decide that the "username" provided should be treated as a
name whenever possible, then it would not make sense to permit the
prefix.  A '-user +123' should strictly match a username of +123;  if
no such user exists (sidebar:  are + and - valid characters in a
username?) we should treat the request as "any user id greater than 123".

In my opinion, the -user and -group primaries should work strictly with
_names_, and _never_ fallback to {u,g}id values;  we could easily add
new primaries -uid and -gid to search for the numeric values.  However,
this would make find(1) incompatible with existing versions.


| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at |

Home | Main Index | Thread Index | Old Index