Re: [PATCH 1/9] chfn, chsh: merge auth.h, islocal.h and libuser.h to ch-common.h

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

 



On Mon, Jul 31, 2017 at 08:55:00PM +0100, Sami Kerola wrote:
> diff --git a/login-utils/Makemodule.am b/login-utils/Makemodule.am
> index 67a0c98ec..2cc91b658 100644
> --- a/login-utils/Makemodule.am
> +++ b/login-utils/Makemodule.am
> @@ -90,20 +90,17 @@ if HAVE_LINUXPAM
>  chfn_chsh_ldadd += -lpam_misc
>  endif
>  chfn_chsh_sources += \
> -	login-utils/auth.c \
> -	login-utils/auth.h
> +	login-utils/auth.c
>  endif # CHFN_CHSH_PASSWORD
>  
>  if HAVE_USER
>  chfn_chsh_ldflags += $(LIBUSER_LIBS)
>  chfn_chsh_cflags += $(LIBUSER_CFLAGS)
>  chfn_chsh_sources+= \
> -	login-utils/libuser.c \
> -	login-utils/libuser.h
> +	login-utils/libuser.c
>  else
>  chfn_chsh_sources += \
>  	login-utils/islocal.c \
> -	login-utils/islocal.h \
>  	login-utils/setpwnam.c \
>  	login-utils/setpwnam.h
>  endif

seems nowhere in the Makefile is our new ch-common.h

> --- a/login-utils/chfn.c
> +++ b/login-utils/chfn.c
> @@ -35,7 +35,6 @@
>  #include "c.h"
>  #include "env.h"
>  #include "closestream.h"
> -#include "islocal.h"
>  #include "nls.h"
>  #include "setpwnam.h"
>  #include "strutils.h"
> @@ -51,9 +50,6 @@
>  
>  #ifdef HAVE_LIBUSER
>  # include <libuser/user.h>
> -# include "libuser.h"
> -#elif CHFN_CHSH_PASSWORD
> -# include "auth.h"
>  #endif

It would be better to include libuser in the ch-common.h
if the function the header file depends on the library.


Frankly, I'm not sure if this patch improves readability of the code.
Now we have to ways (pam and libuser) and both is pretty separated by
.c and .h files. Not sure if merge it makes it better.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux