SUMMARY: dUnix's FTPD umask.

From: Andrew C. Saylor <asaylor_at_alpha.comsource.net>
Date: Mon, 17 Jun 1996 08:30:48 -0500 (CDT)

Well folks I had several good responses to my question. Here they are:

acs> From: Ray Bellis <Ray.Bellis_at_psy.ox.ac.uk>
acs>
acs> With most tty based clients you can type `site umask 0nnn' to set
acs> the umask for any files you subsequently upload. It's not perfect
acs> but it helps.
acs>
acs> Ray.

This works well if your customers are using line mode FTP clients. Newer
version of GUI ftp clients (like WS_FTP and CuteFTP) also provide a
"chmod" function, but this is, of course, another step.
========================================================================

On Fri, 14 Jun 1996, Tim Mooney wrote:
acs> From: Tim Mooney <mooney_at_dogbert.cc.ndsu.NoDak.edu>
acs>
acs> Andrew-
acs>
acs> This has worked for me on other operating systems; I've not needed to try
acs> it on Digital Unix yet. No guarantees, of course.
acs>
acs> Tim
acs> --
acs> Tim Mooney mooney_at_toons.cc.ndsu.NoDak.edu
acs> Information Technology Services (701) 231-1076 (Voice)
acs> Room 242-J6, IACC Bldg. (701) 231-8541 (FAX)
acs> North Dakota State University, Fargo, ND 58105
acs>
acs> /*
acs> * a wrapper for the ftpd daemon, to set the umask to not give r/w for group
acs> * or other.
acs> * compile as:
acs> *
acs> * cc -o ftpd-wrapper ftpd-wrapper.c
acs> *
acs> * then change the /etc/inetd.conf line for `ftpd' so that instead of
acs> * /usr/sbin/ftpd it specifies the path to where this binary is installed.
acs> *
acs> * Restart inetd. When inetd detects a connection on the ftp port, it will
acs> * run this program instead of ftpd. This program sets the umask and then
acs> * just execs the real ftpd.
acs> */
acs>
acs> #include <sys/types.h>
acs> #include <sys/stat.h>
acs> #include <unistd.h>
acs>
acs> int main(int argc, char *argv[])
acs> {
acs> mode_t my_umask;
acs>
acs> my_umask = umask(0077); /* octal 077 */
acs>
acs> #if defined(__svr4__) && defined(__sparc)
acs> execv("/usr/sbin/in.ftpd", argv );
acs> #elif defined(__alpha)
acs> execv("/usr/sbin/ftpd", argv );
acs> #endif
acs>
acs> /* should never get here */
acs> exit(1);
acs> }
acs>


I have not tried this solution but it brings up many intereting ideas.
This simple wrapper could do many things if properly coded. Thanks Tim!
=======================================================================

On Fri, 14 Jun 1996, Henry Azer wrote:
acs> From: Henry Azer <haz_at_ns.webquill.com>
acs> Look in your FTP config.ini and change there. When a directory or file is
acs> created via FTP it will be set as per defult.

I don't know what this one was. There is no "config.ini" file on my
system. Mabey he meant to say the config.h file of the source code, which
is where the default umask is usually located.


Thanks for everyone's help!

-Andy


On Fri, 14 Jun 1996, Andrew C. Saylor wrote:

acs>
acs> All,
acs>
acs> We have an Alpha 2100 running OSF 3.2b and dUnix's FTPD ver 5.60. When a
acs> user uploads a new file (not overwriting an existing one) via FTP, the
acs> file is created with 644 permissions. Is there a way to change these
acs> permissions either globally or an a per-user basis? Or do I need to source
acs> code and have to hack it?
acs>
Received on Mon Jun 17 1996 - 16:11:18 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:46 NZDT