muddleftpd-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Muddleftpd-cvs] muddleftpd ./ChangeLog src/auth.c


From: Beau Kuiper
Subject: [Muddleftpd-cvs] muddleftpd ./ChangeLog src/auth.c
Date: Tue, 19 Nov 2002 20:39:54 -0500

CVSROOT:        /cvsroot/muddleftpd
Module name:    muddleftpd
Changes by:     Beau Kuiper <address@hidden>    02/11/19 20:39:52

Modified files:
        .              : ChangeLog 
        src            : auth.c 

Log message:
        Added feature to set a users gid to the gid of a user in the password 
file

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/muddleftpd/muddleftpd/ChangeLog.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/muddleftpd/muddleftpd/src/auth.c.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: muddleftpd/ChangeLog
diff -c muddleftpd/ChangeLog:1.4 muddleftpd/ChangeLog:1.5
*** muddleftpd/ChangeLog:1.4    Tue Oct 29 00:01:38 2002
--- muddleftpd/ChangeLog        Tue Nov 19 20:39:47 2002
***************
*** 1,3 ****
--- 1,10 ----
+ 2002-11-20  Beau Kuiper <address@hidden>
+ 
+       * src/acl.c: transfer_config(): Added code that allows the server
+       to retrieve the gid a user will operate as from the password file.
+       Just put "!" in front of the gid parameter. (eg gid !anuser) will
+       give the user the gid of the user anuser.
+ 
  2002-10-29  Beau Kuiper <address@hidden>
  
        * src/string.c: string_filterbadchars(): Added code to only allow
Index: muddleftpd/src/auth.c
diff -c muddleftpd/src/auth.c:1.1 muddleftpd/src/auth.c:1.2
*** muddleftpd/src/auth.c:1.1   Thu Sep 26 03:55:42 2002
--- muddleftpd/src/auth.c       Tue Nov 19 20:39:51 2002
***************
*** 120,125 ****
--- 120,126 ----
                        case ']':
                        case '\\':
                        case '!':
+                       case ':':
                        case '^':
                                return(TRUE);
                }
***************
*** 325,339 ****
        loadstrfromconfig(config->configfile, section, "gid", &(data), "%g");
        data = strdupwrapper(data);
        data = tokenset_apply(tset, data, FALSE);
        if (sscanf(data, "%d", &intdata) != 1)
        {
!               /* try for username then */
!               struct group *grent;
!               grent = getgrnam(data);
!               if (grent)
!                       peer->gidt_asgid = grent->gr_gid;
!               else
!                       peer->gidt_asgid = config->gidt_nobodygid;
        }
        else
        {
--- 326,354 ----
        loadstrfromconfig(config->configfile, section, "gid", &(data), "%g");
        data = strdupwrapper(data);
        data = tokenset_apply(tset, data, FALSE);
+       
        if (sscanf(data, "%d", &intdata) != 1)
        {
!               /* if it starts with a "!" mark, get gid of username */
!               if (data[0] == '!')
!               {
!                       struct passwd *pwdent;
!                       pwdent = getpwnam(data+1);
!                       if (pwdent)
!                               peer->gidt_asgid = pwdent->pw_gid;
!                       else
!                               peer->gidt_asgid = config->gidt_nobodygid;
!               }
!               else    
!               {
!                       /* try for groupname then */
!                       struct group *grent;
!                       grent = getgrnam(data);
!                       if (grent)
!                               peer->gidt_asgid = grent->gr_gid;
!                       else
!                               peer->gidt_asgid = config->gidt_nobodygid;
!               }
        }
        else
        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]