Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jun 2020 08:43:10 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 236204] Cannot use comma in setenv in login.conf
Message-ID:  <bug-236204-227-SgDAZt0GyX@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-236204-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-236204-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236204

Michael Osipov <michael.osipov@siemens.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|12.0-STABLE                 |12.1-STABLE

--- Comment #3 from Michael Osipov <michael.osipov@siemens.com> ---
I think I have traced down the cause: cap_mkdb uses cgetnext() whose manpage
says:
>      String capability values may contain any character.  Non-printable A=
SCII
>      codes, new lines, and colons may be conveniently represented by the =
use
>      of escape sequences:
>=20
>      ^X        ('X' & 037)          control-X
>      \b, \B    (ASCII 010)          backspace
>      \t, \T    (ASCII 011)          tab
>      \n, \N    (ASCII 012)          line feed (newline)
>      \f, \F    (ASCII 014)          form feed
>      \r, \R    (ASCII 015)          carriage return
>      \e, \E    (ASCII 027)          escape
>      \c, \C    (:)                  colon
>      \\        (\)                  back slash
>      \^        (^)                  caret
>      \nnn      (ASCII octal nnn)

While I have tried to do \054, it is still not working because the setenv m=
agic
is performed with login_getcaplist() in
> ./lib/libutil/login_class.c:    const char      **set_env =3D login_getca=
plist(lc, "setenv", ",");

So also the \054 is converted to comma, the subsequent call adds its own
sematics to split the setenv capability with comma. So it would require
something like \O which is used in login_class only and
 if ((np =3D substvar(p, pwd, hlen, pch, nlen)) !=3D NULL) {
     setenv(*set_env, np, 1);
     free(np);
 }

and np needs to be processed for \O to replace with a comma. If I understand
./lib/libc/gen/getcap.c correctly the blackslash is retained by "*mp++ =3D
*(bp-1)" if the escape char is unknown.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-236204-227-SgDAZt0GyX>