Skip to content

Demonstrate mode/UID/GID parsing ambiguity#561

Closed
saper wants to merge 1 commit intologrotate:mainfrom
saper:mode-uid-gid-parsing-ambiguity
Closed

Demonstrate mode/UID/GID parsing ambiguity#561
saper wants to merge 1 commit intologrotate:mainfrom
saper:mode-uid-gid-parsing-ambiguity

Conversation

@saper
Copy link
Contributor

@saper saper commented Nov 12, 2023

Since we accept numeric UID/GID, we are never
really sure which of the three optional
numeric parameters to "create" or "createolddir"
is really given.

Tried to update manual page to say which
parameters and optional and in which order.

Since we accept numeric UID/GID, we are never
really sure which of the three optional
numeric parameters to "create" or "createolddir"
is really given.

Tried to update manual page to say which
parameters and optional and in which order.
@cgzones
Copy link
Member

cgzones commented Dec 11, 2023

It seems historically create foo bar meant default mode, user foo and group bar, so for backward compatibility create 1001 1002 should mean default mode, user 1001 and group 1002.

Since the user and group strings are always converted to ids with regard to base 10 and the create mode normally should be specified as an octal value a leading 0 could also be used as hint whether the first token is the create mode or user id.

But I think these nuances can get very tricky so maybe it's best to come up with a new syntax altogether?

@saper
Copy link
Contributor Author

saper commented Dec 15, 2023

I think the test in this pull request does not pass, so the first two numbers (if the first one is parseable octally) become mode and the owner.

So I think we have a bug now since numeric UIDs have been introduced. We might need to fix it

cgzones added a commit to cgzones/logrotate that referenced this pull request Jan 5, 2024
Restore old behavior when one or two arguments are specified for the
create and createolddir directives.  This was broken with the
introduction of numeric uid/gid support.

Fixes: logrotate#561
@cgzones cgzones mentioned this pull request Jan 5, 2024
cgzones added a commit to cgzones/logrotate that referenced this pull request Jan 5, 2024
Restore old behavior when one or two arguments are specified for the
create and createolddir directives.  This was broken with the
introduction of numeric uid/gid support.

Fixes: logrotate#561
@cgzones cgzones mentioned this pull request Jan 5, 2024
8 tasks
@cgzones cgzones closed this in #575 Mar 15, 2024
cgzones added a commit that referenced this pull request Mar 15, 2024
Restore old behavior when one or two arguments are specified for the
create and createolddir directives.  This was broken with the
introduction of numeric uid/gid support.

Fixes: #561
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants