7648 useradd/mod commands operate on /home special filesystem

Review Request #286 - Created Dec. 6, 2016 and updated

Information
Alexander Pyhalov
illumos-gate
Reviewers
general

user* commands use hardcoded values from userdefs.h. This patch allows override them at compile time.

Built illumos-gate with following variables added in illumos.sh:

export DEFSHL=/usr/bin/bash
export DEFROLESHL=/usr/bin/pfbash
export DEFPARENT=/export/home
.

Added users using compiled useradd, generated defaults file.

diff -u /usr/include/userdefs.h ./proto/root_i386/usr/include/userdefs.h
--- /usr/include/userdefs.h 2013-08-06 22:38:41.876564000 +0400
+++ ./proto/root_i386/usr/include/userdefs.h 2016-12-06 14:39:27.447626560 +0300
@@ -31,8 +31,6 @@
#ifndef _USERDEFS_H
#define _USERDEFS_H

-#pragma ident "%Z%%M% %I% %E% SMI" / SVr4.0 1.7.1.1 /

#include <project.h>

#ifdef __cplusplus
@@ -51,10 +49,10 @@
#define DEFPROJNAME "default"
#define DEFGROUP 1
#define DEFGNAME "other"
-#define DEFPARENT "/home"
+#define DEFPARENT "/export/home"
#define DEFSKL "/etc/skel"
-#define DEFSHL "/bin/sh"
-#define DEFROLESHL "/bin/pfsh"
+#define DEFSHL "/usr/bin/bash"
+#define DEFROLESHL "/usr/bin/pfbash"
#define DEFINACT 0
#define DEFEXPIRE ""
#define DEFAUTH ""

Rebuilt illumos-gate without setting DEF* variables.
Checked that useradd -m is faulty (tries to create directories under /home) and generated defaults file matches one produced by non-patched version.
diff -u /usr/include/userdefs.h ~/srcs/illumos-gate/proto/root_i386/usr/include/userdefs.h
--- /usr/include/userdefs.h 2013-08-06 22:38:41.876564000 +0400
+++ /export/home/alp/srcs/illumos-gate/proto/root_i386/usr/include/userdefs.h 2016-12-06 16:29:56.888292115 +0300
@@ -31,8 +31,6 @@
#ifndef _USERDEFS_H
#define _USERDEFS_H

-#pragma ident "%Z%%M% %I% %E% SMI" / SVr4.0 1.7.1.1 /

#include <project.h>

#ifdef __cplusplus

Issues

  • 2
  • 3
  • 0
  • 5
Description From Last Updated
Makefile.master is included in just about every make job in the whole system. Does it really make sense for these ... Gordon Ross Gordon Ross
If these are not really constants, would it make more sense do something like what was done for limits.h and ... Gordon Ross Gordon Ross
Igor Kozhukhov
Alexander Pyhalov
Alexander Pyhalov
Toomas Soome
Toomas Soome
Alexander Pyhalov
Toomas Soome
Gordon Ross
Gordon Ross
Toomas Soome
Ship It!
Ken Mays
Ship It!
Loading...