0

目前目录是

/var/www/html/sitename_com/. 该目录归 meder.meder 所有。当我创建这个目录时,不确定我在什么 umask 下。

我的脚本绑定到 pyinotify 并在我mkdir www绑定事件处理程序后设置:

web和用户publisher通过:

  uid = pwd.getpwnam( 'publisher' ).pw_uid
  gid = grp.getgrnam( 'web' ).gr_gid

  os.chown( path, uid, gid )

umask 到0002

  current_umask = os.umask(0)
  print 'umask is ' + str(current_umask)

  os.umask(0002)
  current_umask = os.umask(0)
  print 'updated umask is ' + str(current_umask)

我也是chmod权限。0664 用于文件,0775 用于目录,通过:

    os.chmod( path, int( "0664", 8 ) ) # files

在我mkdirwww 之后,这是我的日志报告:

pre fix its 0755
fixing permission to 0775
fix path is /var/www/html/sitename/www
post fix its 0775
umask is 0
updated umask is 2
former user is meder and former group is meder
attempting to set user to publisher and group to web
post chown user is publisher and former group is web

我无法wwwmeder组中的用户创建文件web

cd www
meder@oskol:/var/www/html/sitename_com/www$ touch file.jpg
touch: cannot touch `file.jpg': Permission denied

我必须为我的用户创建web主要组吗?meder我是否因为没有添加足够的 0 而弄乱了 umask 部分?

4

0 回答 0