[Bug 3206] New: sftp client(32bit) chown command does not support uid >LONG_MAX

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Sun Aug 30 22:33:02 AEST 2020


https://bugzilla.mindrot.org/show_bug.cgi?id=3206

            Bug ID: 3206
           Summary: sftp client(32bit) chown command does not support uid
                    >LONG_MAX
           Product: Portable OpenSSH
           Version: 6.9p1
          Hardware: 68k
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: sftp
          Assignee: unassigned-bugs at mindrot.org
          Reporter: booking00 at sina.cn

Server could accept uid < ULONG_MAX. But client can only accept
uid<LONG_MAX. There is a gap between client and server. Variable l is
defiled as signed long. Is it possible to extend?

sftp> chown 2147483648 execute.sh
You must supply a numeric argument to the chown command.


        case I_CHOWN:
        case I_CHGRP:
                if ((optidx = parse_ch_flags(cmd, argv, argc, hflag))
== -1)
                        return -1;
                /* Get numeric arg (mandatory) */
                if (argc - optidx < 1)
                        goto need_num_arg;
                errno = 0;
                l = strtol(argv[optidx], &cp2, base);
                if (cp2 == argv[optidx] || *cp2 != '\0' ||
                    ((l == LONG_MIN || l == LONG_MAX) && errno ==
ERANGE) ||
                    l < 0) {
 need_num_arg:
                        error("You must supply a numeric argument "
                            "to the %s command.", cmd);
                        return -1;
                }

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list