#888631 dput: Allow override of remote ‘chmod’ operation

#888631#5
Date:
2018-01-28 01:20:17 UTC
From:
To:
Package: dput
Severity: minor
Control: block 389908 by -1
Control: block 876896 by -1


The ‘dput’ command currently forces a change of file permission (a
‘chmod’ operation) when uploading via some methods. This is
undesirable in some environments.

Implement configuration options to specify:

* Whether to perform the ‘chmod’ operation (default: yes).

* What permission flags to set (default: 0o0644).

#888631#14
Date:
2024-11-20 11:54:19 UTC
From:
To:
Hi Ben,
usecases is chmodding actually useful? Why not keep the default that
the remote assigns?

We just had some uploads fail, because:
- scp is nowadays sftp
- our remote does not allow starting shells, only sftp
- when I set this up, dput just worked
- when mika used it, it failed, because his -local- files were mode
  0664 instead of 0644.

And that's just a very strange failure IMO.

tl;dr: can the chmod call just go away?

Chris

#888631#19
Date:
2026-09-30 09:05:32 UTC
From:
To:
I upload packages for Kali Linux, and indeed scp is just sftp, so 'ssh
chmod' is never going to work.

Also, the fact that dput tries to chmod only if one of the files has
permissions != 0644 made it hard to troubleshot. When I just update the
packaging revision for a package, uploads work without error. However if
I update the upstream version, it triggers the issue. Why? Because the
orig.tag.gz, created by uscan, has 0664 permissions, while other files
created by dpkg, have 0644. It's caused by my umask of 0002, which comes
from a change in trixie, amazingly undocumented:
https://bugs.debian.org/1068674.

Put all of that together, and these intermittent failures have been
bugging me for ~ 2 years, before I finally took the time to nail it down.

Mandatory failure logs for completeness:

```
This service allows sftp connections only.
Warning: The execution of 'ssh' as
  'ssh kaliupload@urania.kali.org chmod 0644
/srv/repo.kali.org/incoming/python-sqlalchemy-schemadisplay_2.0-0kali1.dsc
/srv/repo.kali.org/incoming/python-sqlalchemy-schemadisplay_2.0.orig.tar.gz
/srv/repo.kali.org/incoming/python-sqlalchemy-schemadisplay_2.0-0kali1.debian.tar.xz
/srv/repo.kali.org/incoming/python-sqlalchemy-schemadisplay_2.0-0kali1_source.buildinfo
/srv/repo.kali.org/incoming/python-sqlalchemy-schemadisplay_2.0-0kali1_source.changes'
  returned a nonzero exit code.
Error while fixing permissions.
```

Please drop the chmod entirely if it's straightforward! I can propose a
patch if you're open to this change.

Cheers,