util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [pull] login-utils maintenance fixes
@ 2011-11-19 21:43 Sami Kerola
  2011-11-23 16:52 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Sami Kerola @ 2011-11-19 21:43 UTC (permalink / raw)
  To: util-linux

Hi,

This is mostly boring series of maintenance fixes to utilities, which
does not even compile by default.

The following changes since commit 47104bae8975511383bcef5c96545f03bb4e4cce:

  fdisk: split delete_partition() off from dos_delete_partition()
(2011-11-14 15:07:28 +0100)

are available in the git repository at:
  https://github.com/kerolasa/lelux-utiliteetit login-utils

Sami Kerola (21):
      chfn: align with howto-usage-function.txt
      chfn: use libc error printing facilities
      chsh: align with howto-usage-function.txt
      chsh: use libc error printing facilities
      vipw: use libc error printing facilities
      vipw: stop printing non-sense version string
      newgrp: add version and help options
      login: add version printing option
      chfn, chsh, setpwnam: use stdbool.h
      chsh: build bug: do not override config.h definition
      chfn, chsh: share require password error print definition
      build-sys: trust autotools setting *_SOURCES definitions
      islocal: fix coding style
      logindefs: fix coding style
      newgrp: fix coding style
      selinux_utils: fix coding style
      setpwnam: fix coding style
      vipw: fix coding style
      last: possible buffer overflow fixed [smatch scan]
      setpwnam: remove non-ANSI definitions [smatch scan]
      last: fix few compiler warnings

 login-utils/Makefile.am     |    2 +-
 login-utils/chfn.c          |  713 ++++++++++++++++++++++---------------------
 login-utils/chregpw.h       |   16 +
 login-utils/chsh.c          |  578 +++++++++++++++++------------------
 login-utils/islocal.c       |   79 +++---
 login-utils/last.c          |    8 +-
 login-utils/login.1         |    3 +
 login-utils/login.c         |    5 +-
 login-utils/logindefs.c     |   42 ++--
 login-utils/newgrp.c        |  209 ++++++++------
 login-utils/selinux_utils.c |   91 +++---
 login-utils/setpwnam.c      |  312 ++++++++++----------
 login-utils/vipw.c          |  210 ++++++-------
 13 files changed, 1152 insertions(+), 1116 deletions(-)
 create mode 100644 login-utils/chregpw.h

-- 
   Sami Kerola
   http://www.iki.fi/kerolasa/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [pull] login-utils maintenance fixes
  2011-11-19 21:43 [pull] login-utils maintenance fixes Sami Kerola
@ 2011-11-23 16:52 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2011-11-23 16:52 UTC (permalink / raw)
  To: kerolasa; +Cc: util-linux

On Sat, Nov 19, 2011 at 10:43:35PM +0100, Sami Kerola wrote:
>       chfn: use libc error printing facilities

 Please, see how the original code uses "msg" in check_gecos_string().
 I think that proper fix is:

 if (msg)
    warnx (_("%s: '%c' is not allowed"), msg, c);
 else
    warnx (_("'%c' is not allowed"), c);

 and so on...

 It also seems that check_gecos_string() in main() should be called
 with static strings, so you can remove the strcats, the strings
 (e.g. "full name") should be also translated

    status = check_gecos_string(_("full name"), optarg);

 see also ask_info() where are the strings too. It would be better to
 use the same strings :-)

>       chfn, chsh, setpwnam: use stdbool.h

 hmm... what about to use old good 'int'?

>       chfn, chsh: share require password error print definition

 The macros are horrible. Please, see is_pam_failure() and
 loginpam_err() in login.c. I think it would be better to create
 pamfail.h with inline functions / macros. 
 
 Note that we cannot share this code with login.c where is also
 necessary to call syslog() and sleep()).

>       build-sys: trust autotools setting *_SOURCES definitions

 This commit subject is odd... do you mean "fix coding style"? :-)

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-23 16:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-19 21:43 [pull] login-utils maintenance fixes Sami Kerola
2011-11-23 16:52 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).