ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/CCSAdmin/chsh.c
(Generate patch)

Comparing CCSAdmin/chsh.c (file contents):
Revision 582 by douglas, 2005-11-20T15:07:31-08:00 vs.
Revision 583 by douglas, 2005-11-21T12:56:05-08:00

# Line 30 | Line 30 | int main(int argc, char *argv[])
30                  return 1;
31          }
32  
33        typedef struct
34        {
35                const char *name;
36                char *freebsd, *linux, *darwin, *solaris;
37        }
38        Shells;
39
40        typedef enum { sh, csh, tcsh, bash, ksh, zsh, _3sh, custom } Shell;
41
42        Shells shells[] = {
43                { "sh", "/bin/sh", "/bin/sh", "/bin/sh", "/usr/bin/sh" },
44                { "csh", "/bin/csh", "/bin/csh", "/bin/csh", "/usr/bin/csh" },
45                { "tcsh", "/bin/tcsh", "/bin/tcsh", "/bin/tcsh", "/usr/bin/tcsh" },
46                { "bash", "/usr/local/bin/bash", "/bin/bash", "/bin/bash", "/usr/bin/bash" },
47                { "ksh", "/usr/local/bin/ksh", "/bin/ksh", "/bin/ksh", "/usr/bin/ksh" },
48                { "zsh", "/usr/local/bin/zsh", "/bin/zsh", "/bin/zsh", "/usr/bin/zsh" },
49                { "3sh", "/ccs/bin/3sh", "/ccs/bin/3sh", "/ccs/bin/3sh", "/ccs/bin/3sh" },
50                { "custom", NULL, NULL, NULL, NULL }
51        };
52
33          char *shell_regex = NULL;
34  
35          {
# Line 180 | Line 160 | no:    check(setuid(geteuid()), environment
160          if (!(bash_ = check(fork(), environment)))
161          {
162                  check(setenv("USER", user, 1), environment);
163 <                check(setenv("FREEBSD", shells_->freebsd, 1), environment);
184 <                check(setenv("LINUX", shells_->linux, 1), environment);
185 <                check(setenv("DARWIN", shells_->darwin, 1), environment);
186 <                check(setenv("SOLARIS", shells_->solaris, 1), environment);
163 >                setshells(shells_, environment);
164                  check(execl("/ccs/bin/chsh.sh", argv[0], NULL), environment);
165          }
166  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines