DevHeads.net

Review Request 110315: Also recognize an openSUSE/SUSE installation and create the kdm user and group properly

Review request for kde-workspace, Luboš Luňák and Oswald Buddenhagen.

Description
This patch allows for the recognition of an openSUSE/SUSE installation and utilizes the correct tools to create the kdm user and group. This would fix an very old situation where at this moment only debian installations were recognized and properly handled.

The code follows the coding for debian

Diffs
kdm/kfrontend/genkdmconf.c 69b42f1

Diff: <a href="http://git.reviewboard.kde.org/r/110315/diff/" title="http://git.reviewboard.kde.org/r/110315/diff/">http://git.reviewboard.kde.org/r/110315/diff/</a>

Testing
Testing has been done on a couple of openSUSE systems and here the user and group were properly created and no more error messages were shown.

Thanks,

Raymond Wooninck

Comments

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Raymond Wooninck at 05/05/2013 - 03:04

(Updated May 5, 2013, 8:04 a.m.)

Review request for kde-workspace, Luboš Luňák and Oswald Buddenhagen.

Changes
Get ride of some whitespaces at the end of the line

Description
This patch allows for the recognition of an openSUSE/SUSE installation and utilizes the correct tools to create the kdm user and group. This would fix an very old situation where at this moment only debian installations were recognized and properly handled.

The code follows the coding for debian

Diffs (updated)
kdm/kfrontend/genkdmconf.c 69b42f1

Diff: <a href="http://git.reviewboard.kde.org/r/110315/diff/" title="http://git.reviewboard.kde.org/r/110315/diff/">http://git.reviewboard.kde.org/r/110315/diff/</a>

Testing
Testing has been done on a couple of openSUSE systems and here the user and group were properly created and no more error messages were shown.

Thanks,

Raymond Wooninck

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Raymond Wooninck at 05/05/2013 - 05:53

(Updated May 5, 2013, 10:53 a.m.)

Review request for kde-workspace, Luboš Luňák and Oswald Buddenhagen.

Changes
Unified approach for debian and openSUSE based on useradd

Description
This patch allows for the recognition of an openSUSE/SUSE installation and utilizes the correct tools to create the kdm user and group. This would fix an very old situation where at this moment only debian installations were recognized and properly handled.

The code follows the coding for debian

Diffs (updated)
kdm/kfrontend/genkdmconf.c 69b42f1

Diff: <a href="http://git.reviewboard.kde.org/r/110315/diff/" title="http://git.reviewboard.kde.org/r/110315/diff/">http://git.reviewboard.kde.org/r/110315/diff/</a>

Testing
Testing has been done on a couple of openSUSE systems and here the user and group were properly created and no more error messages were shown.

Thanks,

Raymond Wooninck

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Raymond Wooninck at 05/05/2013 - 06:22

(Updated May 5, 2013, 11:22 a.m.)

Review request for kde-workspace, Luboš Luňák and Oswald Buddenhagen.

Changes
useradd should work equally on all distro's, therefore the distro check is removed and if useradd is found, then the greeteruid is created.

Description
This patch allows for the recognition of an openSUSE/SUSE installation and utilizes the correct tools to create the kdm user and group. This would fix an very old situation where at this moment only debian installations were recognized and properly handled.

The code follows the coding for debian

Diffs (updated)
kdm/kfrontend/genkdmconf.c 69b42f1

Diff: <a href="http://git.reviewboard.kde.org/r/110315/diff/" title="http://git.reviewboard.kde.org/r/110315/diff/">http://git.reviewboard.kde.org/r/110315/diff/</a>

Testing
Testing has been done on a couple of openSUSE systems and here the user and group were properly created and no more error messages were shown.

Thanks,

Raymond Wooninck

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Oswald Buddenhagen at 05/05/2013 - 06:26

kdm/kfrontend/genkdmconf.c
<http://git.reviewboard.kde.org/r/110315/#comment23888>

you didn't compile that ...

- Oswald Buddenhagen

On May 5, 2013, 11:22 a.m., Raymond Wooninck wrote:

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Raymond Wooninck at 05/05/2013 - 06:37

(Updated May 5, 2013, 11:37 a.m.)

Review request for kde-workspace, Luboš Luňák and Oswald Buddenhagen.

Changes
Resolve the compile issue

Description
This patch allows for the recognition of an openSUSE/SUSE installation and utilizes the correct tools to create the kdm user and group. This would fix an very old situation where at this moment only debian installations were recognized and properly handled.

The code follows the coding for debian

Diffs (updated)
kdm/kfrontend/genkdmconf.c 69b42f1

Diff: <a href="http://git.reviewboard.kde.org/r/110315/diff/" title="http://git.reviewboard.kde.org/r/110315/diff/">http://git.reviewboard.kde.org/r/110315/diff/</a>

Testing
Testing has been done on a couple of openSUSE systems and here the user and group were properly created and no more error messages were shown.

Thanks,

Raymond Wooninck

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Raymond Wooninck at 05/05/2013 - 07:02

(Updated May 5, 2013, 12:02 p.m.)

Review request for kde-workspace, Luboš Luňák and Oswald Buddenhagen.

Changes
Fixes the compiler warning.

Description
This patch allows for the recognition of an openSUSE/SUSE installation and utilizes the correct tools to create the kdm user and group. This would fix an very old situation where at this moment only debian installations were recognized and properly handled.

The code follows the coding for debian

Diffs (updated)
kdm/kfrontend/genkdmconf.c 69b42f1

Diff: <a href="http://git.reviewboard.kde.org/r/110315/diff/" title="http://git.reviewboard.kde.org/r/110315/diff/">http://git.reviewboard.kde.org/r/110315/diff/</a>

Testing
Testing has been done on a couple of openSUSE systems and here the user and group were properly created and no more error messages were shown.

Thanks,

Raymond Wooninck

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Commit Hook at 05/05/2013 - 08:31

(Updated May 5, 2013, 1:31 p.m.)

Status
This change has been marked as submitted.

Review request for kde-workspace, Luboš Luňák and Oswald Buddenhagen.

Description
This patch allows for the recognition of an openSUSE/SUSE installation and utilizes the correct tools to create the kdm user and group. This would fix an very old situation where at this moment only debian installations were recognized and properly handled.

The code follows the coding for debian

Diffs
kdm/kfrontend/genkdmconf.c 69b42f1

Diff: <a href="http://git.reviewboard.kde.org/r/110315/diff/" title="http://git.reviewboard.kde.org/r/110315/diff/">http://git.reviewboard.kde.org/r/110315/diff/</a>

Testing
Testing has been done on a couple of openSUSE systems and here the user and group were properly created and no more error messages were shown.

Thanks,

Raymond Wooninck

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Commit Hook at 05/05/2013 - 08:31

This review has been submitted with commit c44df47be1ddf69df381ff44595c2332c83fab60 by Raymond Wooninck to branch master.

- Commit Hook

On May 5, 2013, 12:02 p.m., Raymond Wooninck wrote:

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Oswald Buddenhagen at 05/05/2013 - 08:09

Ship it!

Ship It!

- Oswald Buddenhagen

On May 5, 2013, 12:02 p.m., Raymond Wooninck wrote:

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Oswald Buddenhagen at 05/05/2013 - 06:41

kdm/kfrontend/genkdmconf.c
<http://git.reviewboard.kde.org/r/110315/#comment23889>

and now you ignored the warning from the compiler. ;)

- Oswald Buddenhagen

On May 5, 2013, 11:37 a.m., Raymond Wooninck wrote:

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Raymond Wooninck at 05/05/2013 - 07:16

Apologies, my C/C++ knowledge is quite rusty :-)

- Raymond

On May 5, 2013, 12:02 p.m., Raymond Wooninck wrote:

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Oswald Buddenhagen at 05/05/2013 - 06:01

kdm/kfrontend/genkdmconf.c
<http://git.reviewboard.kde.org/r/110315/#comment23883>

i wonder whether this condition is actually useful. i originally added it because some *BSDs (iirc) had an incompatible adduser command. the situation may be entirely different for useradd.

- Oswald Buddenhagen

On May 5, 2013, 10:53 a.m., Raymond Wooninck wrote:

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Raymond Wooninck at 05/05/2013 - 06:19

I guess that we could rely on the fact that if useradd is found, the command would work in the same way for all distro's. I will update the patch and just leave the check for useradd

- Raymond

On May 5, 2013, 10:53 a.m., Raymond Wooninck wrote:

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Oswald Buddenhagen at 05/05/2013 - 05:08

useradd also exists on debian ("useradd is a low level utility for adding users. On Debian, administrators should usually use adduser(8) instead."), so in principle the paths can be unified.

however, when i was trying to implement this a decade or so ago, useradd was apparently requiring the caller to provide a UID, at which point i simply gave up. did i look wrong? or is this feature a semi-new addition?

- Oswald Buddenhagen

On May 5, 2013, 8:04 a.m., Raymond Wooninck wrote:

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Raymond Wooninck at 05/05/2013 - 05:38

Further checking indicates that openSUSE is currently using shadow-4.1.5.1, which seems to come from debian as that the source tarball is
http://pkg-shadow.alioth.debian.org/releases/shadow-%{version}.tar.bz2

openSUSE added only a few patches to run a script to update a NIS database, so based on this I assume we can unified the coding. I will create a new patch in the next hour.

- Raymond

On May 5, 2013, 8:04 a.m., Raymond Wooninck wrote:

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By =?utf-8?Q?Thoma... at 05/05/2013 - 05:37

O.o?

I've *never* explicitly added a UID to useradd - and yes, i'm that old ;-)

As a "reference", a p-l article from 1999
<a href="http://www.pro-linux.de/artikel/2/893/useradd.html" title="http://www.pro-linux.de/artikel/2/893/useradd.html">http://www.pro-linux.de/artikel/2/893/useradd.html</a>

and here's a manpage, mentioning 1995 as last edition date
<a href="http://static.cray-cyber.org/Documentation/NEC_SX_R10_1/G1AH03E/USERADD.1M.HTML" title="http://static.cray-cyber.org/Documentation/NEC_SX_R10_1/G1AH03E/USERADD.1M.HTML">http://static.cray-cyber.org/Documentation/NEC_SX_R10_1/G1AH03E/USERADD....</a>

- Thomas

On May 5, 2013, 8:04 a.m., Raymond Wooninck wrote:

Re: Review Request 110315: Also recognize an openSUSE/SUSE insta

By Raymond Wooninck at 05/05/2013 - 05:29

According to the useradd man-page on openSUSE:

-r, --system
Create a system account.

System users will be created with no aging information in /etc/shadow, and their numeric identifiers are chosen in the
SYS_UID_MIN-SYS_UID_MAX range, defined in /etc/login.defs, instead of UID_MIN-UID_MAX (and their GID counterparts for the creation of
groups).

-u, --uid UID
The numerical value of the user's ID. This value must be unique, unless the -o option is used. The value must be non-negative. The
default is to use the smallest ID value greater than or equal to UID_MIN and greater than every other user.

So if UID is not given, then it will be determined through the default (as indicated).

I am also not sure if debian and openSUSE have the same version of useradd, so that the two could be merged in a single statement. If you are running debian, then please send me the man page for useradd and I will update the patch with a unified approach.

- Raymond

On May 5, 2013, 8:04 a.m., Raymond Wooninck wrote: