Re: [systemd-devel] [PATCH] sysusers: remove additional finger information from gecos

2015-02-07 Thread Sami Kerola
On 7 February 2015 at 23:50, Mantas Mikulėnas graw...@gmail.com wrote:
 On Sun, Feb 8, 2015 at 1:38 AM, Sami Kerola kerol...@iki.fi wrote:

 This change removes garbage from authentication messages if chfn(1) has
 been used.  For example;

 $ timedatectl set-timezone Europe/London
 [...]
 Authenticating as: Sami Kerola,office,officephone,homephone, (kerolasa)
 ---
  src/sysusers/sysusers.c | 4 
  1 file changed, 4 insertions(+)


 This authentication prompt is part of polkit's pkttyagent (src/polkitagent),
 it has nothing to do with systemd-sysusers.

 (The systemd-sysusers tool is just for adding *new* accounts to
 /etc/passwd... As far as I can see, i-description is only used for
 filtering out duplicates.)

Hi Mantas,

Oh, I see. No wonder I found so few gecos references from systemd
source tree. With your hint I found the following function that might
be the one needing adjustment.

http://cgit.freedesktop.org/polkit/tree/src/polkitagent/polkitagenttextlistener.c#n336

-- 
Sami Kerola
http://www.iki.fi/kerolasa/
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] sysusers: remove additional finger information from gecos

2015-02-07 Thread Mantas Mikulėnas
On Sun, Feb 8, 2015 at 1:38 AM, Sami Kerola kerol...@iki.fi wrote:

 This change removes garbage from authentication messages if chfn(1) has
 been used.  For example;

 $ timedatectl set-timezone Europe/London
 [...]
 Authenticating as: Sami Kerola,office,officephone,homephone, (kerolasa)
 ---
  src/sysusers/sysusers.c | 4 
  1 file changed, 4 insertions(+)


This authentication prompt is part of polkit's pkttyagent
(src/polkitagent), it has nothing to do with systemd-sysusers.

(The systemd-sysusers tool is just for adding *new* accounts to
/etc/passwd... As far as I can see, i-description is only used for
filtering out duplicates.)

-- 
Mantas Mikulėnas graw...@gmail.com
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] sysusers: remove additional finger information from gecos

2015-02-07 Thread Sami Kerola
This change removes garbage from authentication messages if chfn(1) has
been used.  For example;

$ timedatectl set-timezone Europe/London
[...]
Authenticating as: Sami Kerola,office,officephone,homephone, (kerolasa)
---
 src/sysusers/sysusers.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index f25ece0..c94fe58 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -885,12 +885,16 @@ static int add_user(Item *i) {
 errno = 0;
 p = getpwnam(i-name);
 if (p) {
+char *comma;
+
 log_debug(User %s already exists., i-name);
 i-uid = p-pw_uid;
 i-uid_set = true;
 
 free(i-description);
 i-description = strdup(p-pw_gecos);
+if ((comma = strchr(i-description, ',')))
+*comma = '\0';
 return 0;
 }
 if (!IN_SET(errno, 0, ENOENT))
-- 
2.3.0

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel