82fd3e
diff -up ./NEWS.ori ./NEWS
82fd3e
--- ./NEWS.ori	2022-08-15 11:59:35.929714848 +0200
82fd3e
+++ ./NEWS	2022-08-15 12:00:12.892937479 +0200
82fd3e
@@ -1,4 +1,14 @@
82fd3e
 procps-ng-NEXT
82fd3e
+<<<<<<< HEAD
82fd3e
+=======
82fd3e
+  * library
82fd3e
+    Re-add elogind support                                 merge #151
82fd3e
+  * ps: threads again display when -L is used with -q      issue #234
82fd3e
+  * ps: proper aix format string behavior was restored
82fd3e
+  * sysctl: print dotted keys again
82fd3e
+
82fd3e
+procps-ng-4.0.0
82fd3e
+>>>>>>> b159c198 (sysctl: print dotted keys again)
82fd3e
 ---------------
82fd3e
   * Rename pwait to pidwait
82fd3e
 
82fd3e
diff -up ./sysctl.c.ori ./sysctl.c
82fd3e
--- ./sysctl.c.ori	2022-08-15 11:59:35.934714878 +0200
82fd3e
+++ ./sysctl.c	2022-08-15 12:00:12.893937485 +0200
82fd3e
@@ -152,7 +152,7 @@ static SysctlSetting *setting_new(
82fd3e
         strcat(path + proc_len, key+1);
82fd3e
     else
82fd3e
         strcat(path + proc_len, key);
82fd3e
-    /* change . to / */
82fd3e
+    /* change . to / for path */
82fd3e
     slashdot(path + proc_len, '.', '/');
82fd3e
 
82fd3e
     s = xmalloc(sizeof(SysctlSetting));
82fd3e
@@ -510,7 +510,8 @@ static int WriteSetting(
82fd3e
 
82fd3e
     int rc = EXIT_SUCCESS;
82fd3e
     FILE *fp;
82fd3e
-	struct stat ts;
82fd3e
+    struct stat ts;
82fd3e
+    char *dotted_key;
82fd3e
 
82fd3e
     if (!key || !path)
82fd3e
         return rc;
82fd3e
@@ -523,13 +524,22 @@ static int WriteSetting(
82fd3e
         return rc;
82fd3e
 	}
82fd3e
 
82fd3e
-	if ((ts.st_mode & S_IWUSR) == 0) {
82fd3e
-		xwarn(_("setting key \"%s\""), key);
82fd3e
+    /* Convert the globbed path into a dotted key */
82fd3e
+    if ( (dotted_key = strdup(path + strlen(PROC_PATH))) == NULL) {
82fd3e
+	xerrx(EXIT_FAILURE, _("strdup key"));
82fd3e
+	return EXIT_FAILURE;
82fd3e
+    }
82fd3e
+    slashdot(dotted_key, '/', '.');
82fd3e
+
82fd3e
+    if ((ts.st_mode & S_IWUSR) == 0) {
82fd3e
+        xwarn(_("setting key \"%s\""), dotted_key);
82fd3e
+	free(dotted_key);
82fd3e
         return rc;
82fd3e
 	}
82fd3e
 
82fd3e
-	if (S_ISDIR(ts.st_mode)) {
82fd3e
-		xwarn(_("setting key \"%s\""), key);
82fd3e
+    if (S_ISDIR(ts.st_mode)) {
82fd3e
+        xwarn(_("setting key \"%s\""), dotted_key);
82fd3e
+	free(dotted_key);
82fd3e
         return rc;
82fd3e
 	}
82fd3e
 
82fd3e
@@ -539,7 +549,7 @@ static int WriteSetting(
82fd3e
             case ENOENT:
82fd3e
                 if (!IgnoreError) {
82fd3e
                     xwarnx(_("\"%s\" is an unknown key%s"),
82fd3e
-                           key, (ignore_failure?_(", ignoring"):""));
82fd3e
+                           dotted_key, (ignore_failure?_(", ignoring"):""));
82fd3e
 				if (!ignore_failure)
82fd3e
 				    rc = EXIT_FAILURE;
82fd3e
 			}
82fd3e
@@ -548,11 +558,11 @@ static int WriteSetting(
82fd3e
             case EROFS:
82fd3e
             case EACCES:
82fd3e
                 xwarnx(_("permission denied on key \"%s\"%s"),
82fd3e
-                       key, (ignore_failure?_(", ignoring"):""));
82fd3e
+                       dotted_key, (ignore_failure?_(", ignoring"):""));
82fd3e
                 break;
82fd3e
             default:
82fd3e
                 xwarn(_("setting key \"%s\"%s"),
82fd3e
-                      key, (ignore_failure?_(", ignoring"):""));
82fd3e
+                      dotted_key, (ignore_failure?_(", ignoring"):""));
82fd3e
                 break;
82fd3e
             }
82fd3e
             if (!ignore_failure && errno != ENOENT)
82fd3e
@@ -561,7 +571,7 @@ static int WriteSetting(
82fd3e
 	    if (0 < fprintf(fp, "%s\n", value))
82fd3e
 		rc = EXIT_SUCCESS;
82fd3e
             if (close_stream(fp) != 0) {
82fd3e
-                xwarn(_("setting key \"%s\""), path);
82fd3e
+                xwarn(_("setting key \"%s\""), dotted_key);
82fd3e
                 return rc;
82fd3e
             }
82fd3e
         }
82fd3e
@@ -571,7 +581,7 @@ static int WriteSetting(
82fd3e
             printf("%s\n", value);
82fd3e
         } else {
82fd3e
             if (PrintName) {
82fd3e
-                printf("%s = %s\n", path, value);
82fd3e
+                printf("%s = %s\n", dotted_key, value);
82fd3e
             } else {
82fd3e
                 if (PrintNewline)
82fd3e
                     printf("%s\n", value);
82fd3e
@@ -580,6 +590,7 @@ static int WriteSetting(
82fd3e
             }
82fd3e
         }
82fd3e
     }
82fd3e
+    free(dotted_key);
82fd3e
     return rc;
82fd3e
 }
82fd3e
 
82fd3e
diff -up ./testsuite/sysctl_slash_test.conf.ori ./testsuite/sysctl_slash_test.conf
82fd3e
--- ./testsuite/sysctl_slash_test.conf.ori	2022-08-15 12:00:12.894937491 +0200
82fd3e
+++ ./testsuite/sysctl_slash_test.conf	2022-08-15 12:00:12.893937485 +0200
82fd3e
@@ -0,0 +1 @@
82fd3e
+kernel/hostname = procps-test
82fd3e
diff -up ./testsuite/sysctl.test/sysctl_write.exp.ori ./testsuite/sysctl.test/sysctl_write.exp
82fd3e
--- ./testsuite/sysctl.test/sysctl_write.exp.ori	2022-08-15 11:59:35.934714878 +0200
82fd3e
+++ ./testsuite/sysctl.test/sysctl_write.exp	2022-08-15 12:00:12.893937485 +0200
82fd3e
@@ -3,11 +3,19 @@ set sysctl ${topdir}sysctl
82fd3e
 
82fd3e
 set test "sysctl write from command line"
82fd3e
 spawn $sysctl --dry-run kernel.hostname=procps-test
82fd3e
-expect_pass "$test" "/proc/sys/kernel/hostname = procps-test"
82fd3e
+expect_pass "$test" "kernel.hostname = procps-test"
82fd3e
+
82fd3e
+set test "sysctl write from command line using slash"
82fd3e
+spawn $sysctl --dry-run kernel/hostname=procps-test
82fd3e
+expect_pass "$test" "kernel.hostname = procps-test"
82fd3e
 
82fd3e
 set test "sysctl write from configuration file"
82fd3e
 spawn $sysctl --dry-run -f ${topdir}testsuite/sysctl_glob_test.conf
82fd3e
-expect_pass "$test" "/proc/sys/fs/protected_fifos = 2\\s+/proc/sys/fs/protected_symlinks = 2\\s+/proc/sys/fs/protected_hardlinks = 1"
82fd3e
+expect_pass "$test" "fs.protected_fifos = 2\\s+fs.protected_symlinks = 2\\s+fs.protected_hardlinks = 1"
82fd3e
+
82fd3e
+set test "sysctl write from file with slashes"
82fd3e
+spawn $sysctl --dry-run -f ${topdir}testsuite/sysctl_slash_test.conf
82fd3e
+expect_pass "$test" "kernel.hostname = procps-test"
82fd3e
 
82fd3e
 set hostname_file "/proc/sys/kernel/hostname"
82fd3e
 if {[file exists ${hostname_file}]} {
82fd3e
@@ -25,5 +33,5 @@ if {[file exists ${hostname_file}]} {
82fd3e
     expect_spawn_retval "$test" 0
82fd3e
   }
82fd3e
 } else {
82fd3e
-  unsupported "sysctl write: hostname file doe not exist"
82fd3e
+  unsupported "sysctl write: hostname file does not exist"
82fd3e
 }