Bug#1043084: chrootuid: please consider upgrading to 3.0 source format

2023-10-03 Thread Bastian Germann

I am uploading a NMU in order to fix this.
The debdiff is attached.diff -Nru chrootuid-1.3/chrootuid.1 chrootuid-1.3/chrootuid.1
--- chrootuid-1.3/chrootuid.1   2023-10-03 20:34:41.0 +0200
+++ chrootuid-1.3/chrootuid.1   2001-07-25 18:46:59.0 +0200
@@ -8,7 +8,7 @@
 .SH SYNOPSIS
 .na
 .nf
-\fBchrootuid\fR [-i] \fInewroot newuser command\fR...
+\fBchrootuid\fR \fInewroot newuser command\fR...
 .SH DESCRIPTION
 .ad
 .fi
@@ -24,32 +24,19 @@
 in the restricted environment.
 
 Only the superuser can use the \fBchrootuid\fR command.
-
-.SH OPTIONS
-.ad
-.fi
-There is only one option for \fBchrootuid\fR: -i. That option makes it
-run in \fIinteractive\fR mode. Errors will be printed on stderr instead of 
through 
-syslog and the exit status will be 1 if there are any errors.
-
-.SH RETURN CODES
-.ad
-.fi
-The exit status of \fBchrootuid\fR when running on \fIdaemon\fR mode 
-(default) is always 0. 
-
-If it is running on \fIinteractive\fR mode, it will exit with an exit status of
-1 if there is any error in its invocation, otherwise the exit status is the
-exit status of \fIcommand\fR.
 .SH DIAGNOSTICS
 .ad
 .fi
-Problems are reported to the syslog daemon if running on \fIdaemon\fR mode.
-If running on \fIinteractive\fR mode, errors are reported on stderr.
+The exit status is 1 when \fBchrootuid\fR has a problem, otherwise
+the exit status is the exit status of \fIcommand\fR.
 .SH SEE ALSO
 .na
 .nf
 chroot(8), su(1)
+.SH DIAGNOSTICS
+.ad
+.fi
+Problems are reported to the syslog daemon.
 .SH AUTHOR(S)
 .na
 .nf
@@ -68,7 +55,7 @@
 .SH LAST MODIFICATION
 .na
 .nf
-Mon May 20 22:49:02 CEST 2007
+Wed Jul 25 11:25:08 EDT 2001
 .SH VERSION/RELEASE
 .na
 .nf
diff -Nru chrootuid-1.3/chrootuid.c chrootuid-1.3/chrootuid.c
--- chrootuid-1.3/chrootuid.c   2023-10-03 20:34:41.0 +0200
+++ chrootuid-1.3/chrootuid.c   2001-07-25 18:47:44.0 +0200
@@ -50,23 +50,15 @@
 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
-extern char *optarg;
-extern int optind, opterr, optopt;
-
 
 int main(argc, argv)
 int argc;
 char  **argv;
 {
 struct passwd *pwd;
-int interactive = 1;
-int optstart = 0;
 
 /*
  * Open a channel to the syslog daemon. Older versions of openlog()
@@ -85,91 +77,45 @@
  * No need to make inetd complain, too.
  */
 
-/* If we use -i, skip it over and increment optstart */
-/* we cannot use the getopt library using:
- * if (getopt(argc, argv, "i") != -1) {
- * in order to preserve the arguments provided to the command
- * This means that -i must be the *first* (and only) argument */
-if ( argv[1] != NULL && strncmp(argv[1], "-i", 2) == 0 ) {
-   interactive = 0;
-optstart++;
-}
-
-if (argc-optstart < 4) {
-   if (interactive) {
-   syslog(LOG_ERR, "usage: %s [-i] path user command", argv[0]);
-   } else {
-  fprintf(stderr,"usage: %s [-i] path user command\n", argv[0]);
-  return (1);
-   }
+if (argc < 4) {
+   syslog(LOG_ERR, "usage: %s path user command", argv[0]);
return (0);
 }
 /* Must step into the new subtree. */
 
-if (chdir(argv[1+optstart])) {
-   if (interactive) {
-   syslog(LOG_ERR, "chdir(%s): %m", argv[1+optstart]);
-   return (0);
-   } else {
-   fprintf(stderr, "chdir(%s): %s\n", argv[1+optstart], 
strerror(errno));
-  return (1);
-   }
+if (chdir(argv[1])) {
+   syslog(LOG_ERR, "chdir(%s): %m", argv[1]);
+   return (0);
 }
 /* The user must be known in the *unrestricted* universe... */
 
-if ((pwd = getpwnam(argv[2+optstart])) == 0) {
-   if (interactive) {
-   syslog(LOG_ERR, "%s: user unknown", argv[2+optstart]);
-   return (0);
-   } else {
-   fprintf(stderr, "%s: user unknown\n", argv[2+optstart]);
-   return (1);
-   }
+if ((pwd = getpwnam(argv[2])) == 0) {
+   syslog(LOG_ERR, "%s: user unknown", argv[2]);
+   return (0);
 }
 /* initgroups() accesses the group file in the unrestricted universe... */
 
 if (initgroups(pwd->pw_name, pwd->pw_gid) < 0) {
-   if (interactive) {
-   syslog(LOG_ERR, "initgroups: %m");
-   return (0);
-   } else {
-   fprintf(stderr, "initgroups: %s\n", strerror(errno));
-   return (1);
-   }
+   syslog(LOG_ERR, "initgroups: %m");
+   return (0);
 }
 endgrent();
 
 /* Do the chroot() before giving away root privileges. */
 
-if (chroot(argv[1+optstart])) {
-   if (interactive) {
-   syslog(LOG_ERR, "chroot(%s): %m", argv[1+optstart]);
-   return (0);
-   } else {
-   fprintf(stderr, "chroot(%s): %s\n", argv[1+optstart], 
strerror(errno));
-   return (1);
-   }
-
+if (chroot(argv[1])) {
+   syslog(LOG_ERR, "chroot(%s): %m", 

Bug#1043084: chrootuid: please consider upgrading to 3.0 source format

2023-08-05 Thread Bastian Germann

Source: chrootuid
Version: 1.3-6.1
Severity: wishlist

This package is among the few that still use source format 1.0.
Please upgrade it to source format 3.0:
https://wiki.debian.org/Projects/DebSrc3.0